This is completely normal. Please, allow me to explain.
When you are not actively using your computer, Windows uses the opportunity to perform all kinds of housekeeping tasks, like security scans, backups, disc clean up, disk optimization, and many other tasks that take up a great deal of the computer's resources.
In fact, that's the very reason why Windows waits until you are not actively using your computer to perform these tasks. It wants to make most of the computer's resources available to you when you need them. But when you're not using them, Windows takes that opportunity to catch up with all its internal housekeeping.
So what you're seeing is Windows hard at work doing what it needs to do, then it notices that you have begun to use your computer again, so it immediately shuts down what it's doing in order to return your computer's resources to you.
It's really cool, and that was a great question. Thanks for asking.