ELI5: Why does turning a computer (or things like it) off usually solve the problem?
You ever play the game 'telephone' as a kid? Where a bunch of kids would get in a line and whisper a message to the next kid in line, and by the end what the last kid heard was nothing like what the first kid said? It is kind of like that.
Programs are, at their core, very simple things. They take an input, perform a task, and produce an output. Then, another part of the program takes that output as its input, performs a task, and produces its own output.
Now, just like in our game of telephone, errors do happen. Just as a kid my mess up their message and pass along a mistaken phrase, a task can make a mistake and produce a bad output. Computers can deal with this to an extent, but eventually errors can get so bad that the outputs aren't useful as inputs to other tasks, and the program begins to suffer for it.
Once the message gets so garbled, the only thing you can really do is start over. Rebooting the computer starts the tasks over from scratch, so they can start using good inputs again.
Another reason that I haven't seen mentioned too often is that it is harder to test issues that require software to stay running for a long time. For example, a new version of Windows is tested by first installing it and then doing some simple tasks after a restart. You don't just keep using it just in case something stops working when some timer reaches 42 days or the memory gets too fragmented or whatever (made up issues). It is also incredibly hard to reproduce issues that only happen after it has been running for a long time, as you have to give it the same inputs again, which you probably don't remember a week later. And if you can't reproduce something, it is incredibly hard to check that changing the code fixed it. Therefore it is usually easier to tell users to restart their system, and since they are used to it, noone complains (there are nore inportant issues to resolve first anyway).
It’s like doing a long math question on paper. if you make a mistake somewhere, it’s easier to start over new than try and correct it as you go
Software can be thought of as a cooking recipe.
Programmers writing the recipe, and the computers being the chefs, following the recipe.
Unfortunately, computers are bad chefs with no souls, and will always follow the recipe EXACTLY, to the letter, with NO deviation.
They can't even taste the food. If the food starts tasting wrong, they'll never know, and will just keep following the recipe.
So you've got your dumb computer chef who will never ever go off recipe. It's usually fine, he can make you a thousand soups a day perfectly. But one day, some accident happens and some soup he's cooking you is suddenly WAY too salty. What do you do?
You could add a step into the recipe to add lemon juice, just this one time to save this one soup, to cancel the salt, but you aren't a programmer, so you aren't gonna change the recipe.
But the thing you CAN do is pour out the salty soup, hand him the empty pot, and tell him to make an entirely new soup.
And as long as whatever caused all the salt doesn't happen every time he makes soup (which it probably doesn't), this is will always result in good soup!
I liked an analogy I heard about this involving a chess game. Say you're playing chess with a friend, the game's going on for a long time, and at some point you notice both your bishops are on white squares, which is an invalid board state. (If you don't know chess rules, the bishops start on opposite colored squares, and only move diagonally, so they can't switch colors.)
If you've taken very careful notes of every move made thus far, it might be possible to undo them one by one until you find where you messed up and fix it, but it's a lot easier to just reset the board. This is even more the case with a computer, which has a lot more going on than a chess game, and rarely if ever logs everything that happens while it's running.