What is the science behind percussive maintenance?
Re: how this happens in the first place, or how it happens again soon after "fixing" it- Heat expansion. Power on your device, and everything heats up, and expands slightly. Power it off again, the components cool down and contract. Do that enough times, and the different materials expanding and contracting at different rates leads to connectors "walking" loose.
Three reasons why this is less likely to happen with modern electronics- first is directly related to power/heat cycles. New equipment tends to be more energy efficient, i.e. it doesn't get as hot under normal operating conditions as old stuff did, thus less mechanical stress from thermal cycling.
Two- chips in sockets are rarely used anymore. What some people lament as making it difficult to fix anything is actually a result of the much higher reliability of components, it's unlikely to ever need to replace anything, so connections are more permanent. Also, with flash memory, firmware can be replaced "in circuit" rather than needing to swap out an EPROM.
Three- lighter weight. Don't laugh, really. Consider the difference between a CRT and a LCD panel- a CRT is not only heavy, but oddly shaped, and its case must not only support that weight, but also present controls and connectors to the user that end up being physically far apart. If the case isn't strong enough, it can flex, moving those parts relative to each other. I have a tube HDTV that weighs a ton, and the case has so much flex I can rock the top back and forth an inch or two with the base on a flat surface. Every so often the picture goes dim and blurry, and smacking it near the top on one side (not the middle) of the screen will return it to normal for some time. I one day took it apart and found it had 4 different boards across the bottom, in two pairs- the front to back were connected by soldered ribbon cables, but the left to right were pins and sockets. There were no connectors near the top of the screen, the only reason that was the "magic" spot was leverage- it imparted maximum flex to the case, causing those board connections to move somewhat. After taking it apart and putting it back together, I didn't need to smack it again for a couple years. It started doing it again a couple months ago, and I can't be arsed to fix it again. It's now sitting on my patio with a "free if you can lift it" sign, and a LCD has taken its place in the living room.
I think this has become much less common as modern processes have made products tremendously more reliable than they once were, but I do have a real example and a real explanation:
A few years ago, I noticed that a friend was constantly tapping the front of his home theater audio receiver with his remote control before being able to do things like adjust volume and change the input. I asked him about it, but he had no idea why this worked. Years later, still doing the same thing, I asked him about it and someone out on the Internet had figured out that the IR receiver diode for that model (a through hole part on a nearly completely surface mount circuit board) had not been soldered well due to some process problem or contamination. After a few more months of going through his ritual of tapping the receiver, I finally convinced him to open it up and let me touch the solder joints with an iron. This successfully corrected the bad, intermittent solder joint and he uses it without a problem to this day (still more years later)!
The tapping was almost certainly re-adjusting the bad solder joint, possibly knocking off a small layer of oxidation that was preventing the low voltage from conducting. Once the incomplete joint was melted together, it was no longer a problem.
Calling it 'science' is probably a stretch but it generally makes the hitter feel better :-) The only valid explanation of why it works is mechanical - loose connection or dry joint. Modern electronics seems less amenable to percussive maintenance :-9