The term comes from seafaring. When the ship is filling up with water, the most important thing to do is get it out of the ship, so "all hands to the pump"
In this case "hands" means sailors, rather than the things on the ends on their arms. The phrase is used figuratively when everyone in a team or organisation needs to concentrate on some particular difficult situation.