Sotah, Chapter Eight, Mishnah Six
Our mishnah interprets Deuteronomy 20:9.
And it shall be, when the officers have finished speaking to the people, they shall appoint captains of hosts at the head of the people (Deuteronomy 20:9).
And at the rear of the people they station guards in front of them and others behind them, with iron axes in their hands, and should anyone wish to flee, they have permission to strike his thighs, because the beginning of falling [in battle] is fleeing, as it is said, Israel fled before the Philistines, and the people also suffered a great slaughter (I Samuel 4:17) and elsewhere it states, And the men of Israel fled before the Philistines and fell down slain (ibid 31:1).
The verse states that captains of hosts shall be placed at the head of the people. Our mishnah interprets at the head of the people to mean not just in front of them, leading them into battle, but behind them making sure they do not flee in the face of the enemy. If a soldier tries to flee, the guards may strike him with iron axes in his legs. This would assumedly deter people from fleeing. The mishnah uses two texts to prove that fleeing from the enemy is the beginning of outright defeat.