John Henry gave his all and his life in an effort to show that a manual rock driller could beat a powered drilling machine. This is the part of the legend that is almost universally agreed. (Around Big Bend Tunnel, many dispute that John Henry died after the contest, or even that there was a contest).
Romance takes over: John Henry was trying to defend the jobs of his co-workers by showing that manual labor was better than machine labor.
I agree with David Mamet. John Henry couldn't have been *that* stupid:
"I thought it hypocritical to celebrate John Henry's victory, for, surely, the next man couldn't beat the steam drill-John Henry himself couldn't beat it over a protracted period, and no one would be able to vanquish the next generation of the machine-and, so, our celebration of him was disingenuous." (From *Jafsie and John Henry*)
The mundane facts, as related by self-proclaimed eyewitness C. C. Spencer and others: John Henry was the champion steel driver of the Birmingham area (perhaps of the world). A salesman offered his boss, Captain Dabney, a bet: If John Henry could beat his steam drill, he would win it for the Captain. (I assume that the other side of the bet was that if John Henry lost, the Captain would buy the steam drill.) The Captain offered inducements to John Henry, $50 or $100 and a new suit of clothes if he won.
Thus, it seems that John Henry's motives in undertaking the challenge were to defend his pride, to win the prizes offered by the Captain, and to win a steam drill for the Captain.
He surely wasn't trying to show that men were better at rock drilling than machines.