I've never had this question.
Well, it works on the same principle as wiggling a battery cable sometimes works. 2 things wear out in starters which cause no start. The solenoid which is a pair of high amperage contacts get pitted by their very nature of having to make contact under a very high amperage load. There's an arc every time you hit the starter. You never see it as it's inside the solenoid. Look at one in a starter shop sometime.
Brushes wear out for the same reason. You are throwing a hundred amps through these things when you hit the key.
Now, let's say you hit the key, you hear a click and nothing happens. That's usually the brushes and when you hit the starter, you jar the brushes into contact with the commutator on the armature on the starter. This works the same on fuel pumps that sometimes quit. Sometimes and I say sometimes, you can take a 2x4 about 18 inches long and slap the bottom of the fuel tank while cranking and the shock transmistted by the fuel can actually make the fuel pump start working. Try it some time. You will amaze people. Just don't let me see you with a bad fuel pump and carrying a board