Sailors at the pumps moved handles up and down, rotating the barrel of the windlass to raise anchor. Pumps were also used to empty the bilge (the lowest part of the ship) of water. Wooden ships leaked (some more than others), but not so fast that the crew could not pump the water out. Pumping ship was typically a long, monotonous stretch of work unless enlivened by song.
There were several different types of pumps which account for the variation in the timing of these shanties. In earlier days, the pump handles, or brakes, worked up and down; but later wheel pumps had the brakes attached to the wheel rims.