How did frontline soldiers stay in line during ancient/medieval battles, knowing that they would almost certainly die during the battle?

by StLaminated

I've always wondered how commanders could keep the soldiers on the frontline from fleeing or turning, when they knew for sure that their risk of dying was incredibly high. Especially in ancient Rome, where commanders/consuls would often deploy their rookie legions at the front (as far as i know).

Iphikrates

Not meaning to discourage further discussion, but someone asked almost this exact question some time ago, and I wrote a lengthy answer, which you can find here.

Iguana_on_a_stick

The thread linked by u/Iphikrates should tell you what you want to know, and more importantly correct some very common misconceptions about ancient combat.

I'll just add a small correction to your question: Romans did not deploy rookie legions on the front lines, but in the early-mid republic, their (not-yet-professional) legions did divide the heavy infantry in three age categories, with the youngest and therefore least experienced men (the hastati) being placed in the front lines.

This made sense, since the young men would, on average, have the best stamina, the most energy, and would be the most eager to prove themselves, all of which makes them well suited to be making the first attacks on the enemy line. The older men in the triarii, meanwhile, would provide a steady and experienced reserve force. I write more about this system here.