Obviously this will vary based on time period and style of warfare. I'm asking primarily about the European middle ages (post-phalanx, pre-gunpowder) though I'd love to hear about other cultures too. Did infantry armies really charge headlong into one another as seen in every movie ever, or were pitched battles usually fought by an explicit attacker and defender?
The front rank issue pops up every so often. This previous question has an excellent thread on the matter, starting from u/Hergrim's answer (which should be top.)
On the matter of psychology and depiction of charges, here's a post with answers from u/Iphikrates and u/Iguana_on_a_stick.