This applies more to older electronics. It’s due to microscopic cracks and connections with oxide layers on them. Hitting it can cause enough of a shock to either shut such a microscopic crack, or scrape away a tiny bit of oxide. This is basically the equivalent of cancer in electronics in that if nothing else kills it, solder joint cracks will. It’s just a matter of time and how exposed the electronics is to temperature fluctuations, humidity etc.
Because electronics are still made up of mechanical connections.
Batteries and fuses have spring pressure keeping them touching the terminals.
Circuit boards have solder connections that can crack and break or header pins that make contact with cables or other components.
Relays and switches have metal contacts that must touch and make good connection in order to work.
If any of these mechanical connections get old or worn out or loose or broken, then jostling them around can sometimes cause them to reconnect and start working.
Latest Answers