When sailors returned home from a voyage, they would be paid off in one lump sum. Most would then stay at shoreside establishments catering to sailors until their money ran out. When that happened, the owners ("crimps") would advance money so that the sailors could purchase more food, rum and "companionship" at that establishment at inflated prices.
For centuries, it was common practice to give a sailor one month's wage in advance when they signed on for a voyage. This advance was intended for the purchase of needed clothing and other gear before departure. Often times this money went to repay the crimps. By the middle of the 19th century, captains were paying the advances directly to crimps for providing
crew, bypassing the poor sailor. Thus, most sailors would be working only for their food for the first month of a voyage.
This food was supposed to mostly consist of salt beef. Food provisioners, whenever they could get away with it (which was quite often), would substitute much cheaper and chewier salt
horse for a portion of the salt beef. Even when salt beef was provided, some of it would have been in casks for years before being given to the crew to eat, making it as
hard to chew as salt
horse. It was quite usual for the crew to refer to their food as salt
horse when it was
bad, or dead
horse if it was worse than
bad.
So, for the first month the sailors were working only for their food, their salt
horse, their dead
horse. They were said to be "working off their dead
horse," and were referred to as dead horses themselves. Flogging them to get them to
work harder was a waste of energy. Thus, "you can't beat a dead
horse" to get any more work done.