Like a starter motor, when the component starts to go bad the electrical contacts fail to make contact, so by punching the tank while cranking the engine, it may vibrate the fuel pump enough to contact.
When starters are acting up, sometimes if you hit them with a hammer while cranking, it...