Follow up: movies usually depict the leader/commander of the army in the front leading the charge. Is there any truth to this or would they usually watch from a safe distance?
This is not a question that can truly be answered, for the simple reason that we don't have enough reliable casualty figures for the Middle Ages to make anything but the broadest of conclusions that may or may not be correct. This is a problem common to a lot of history where the records of deaths come down to us through multiple sources, some of which are intended to be entirely rhetorical and others which either didn't use administrative records in their history, or relied on quotations or syntheses of administrative records from secondary or tertiary sources.
However, the problems involved in working out the percentage of casualties in a battle doesn't mean that no one has ever tried, just that the results must be taken with a huge grain of salt. Peter Krentz, for example, has calculated the casualty rates in Ancient Greece from 472-371 BC, and derived an average of 5% dead for the victors and 14% dead for the losers, though this covers a range of 1.7-10% for the victors and 3-25% for the losers. Despite Classical Greek burial customs resulting in reasonably accurate numbers and lists for at least Athens, though, there remains considerable gaps in records of army sizes and losses that Krentz had to fill in with estimates and, occasionally, less reliable sources in order to make his estimates. On the whole, these gaps might not change much - the casualties of unlisted allied troops might, for example, be no greater than those of the city whose numbers are recorded - but it is something worth keeping in mind. This is all guesswork and will almost always be so.
Similarly, Nathan Rosenstein has calculated casualties for Rome between 200 and 168 BC as 0.2-18.8% for victory (4.5% average) and 7.5-50% for defeat (23.5% average), and Richard A. Gabriel and Karen S. Metz took a sampling of battles from 2250-45 BC and calculated casualties as 0.3-11% for the victors (5.5% average) and 24-59.5% for the losers (37.7% average - excludes outliers such as Cannae).
Edit: I can't believe I forgot to mention it, but the high casualties on the losing side were almost entirely caused during the rout - it's unlikely that the losing side lost many more men than the victorious side initially, but once they panicked, broke formation and ran they were extremely vulnerable and would be chased down and killed by the cavalry and/or light armed infantry in order to prevent them from regrouping.
Whether or not these can be applied to the Middle Ages is another question all together. And, unfortunately, this is where the problems of sources become much more noticeable. Far more narrative accounts that don't use administrative records exist and, even when they do, the attention is focused on the gentry and nobility, not on the foot soldier. As an example, at Crecy we have a reasonably accurate figure of 1542 dead knights and men-at-arms in front of the Black Prince's battle, but no effort was made to count those dead scattered across the field (admittedly only a minority) or the dead infantry (an entirely unknown quantity in the first place).
One thing we can say for certain is that medieval people believed that casualties were generally quite low for the victors. A newsletter written by Edward III's chaplain after Crecy puts the English losses at 3 men-at-arms, while the chronicler Geoffrey le Baker, who did use official records in writing his chronicles, records a total of 40 dead English - that's 0.1% of the men-at-arms and 0.3% for the other troops. Figures given for the victors at Dupplin Moor amount to 2.3% (though it totaled 7% of the men-at-arms), at Poitiers 60 men (1% over all), at Formigny 8 men, at Muret one knight and "only a few sergeants", at Bannockburn 2 knights, at Jerba 17 men (1.4%), etc, etc. All these battles feature enemies who lost hundreds or thousands of men (reliably), or even tens of thousands according to the more sensationalist writers. This is a fairly representative sampling of records of medieval battles and, even if at lot of these figures are unverifiable, at least give a ballpark for how medieval authors viewed the way way battles should go - with very few casualties on the side of the victor and very many on the side of the loser.
Putting all this together and drawing on a specific example, let's examine the Battle of Dupplin Moor. The sources give the English 500 men-at-arms, plus possibly a few score of lighter armed infantry, and their frontage as 600 feet. Clifford Rogers, using early modern drill manuals to verify the spacing of files, estimates that the men-at-arms were in three ranks, with any light infantry forming a fourth rank behind. A total of 35 men died on the English side, so if all of the dead were in the front rank, you'd have a 1 in 5 chance of dying. Of course, not all the dead were likely to have been in the front line. Some of the archers on the flanks might have been unlucky, while some men in the second rank might have been killed by an unlucky Scotsman who broke through temporarily or if they went forward to replace a dead or injured comrade.
Regarding positioning in the line, we have very little information on this but, from what is available to us, the chances are that the wealthier you were (and, thus, the more armour you could afford), the closer you were to the front. The wealthiest infantry, with good textile armour or mail, would have formed either the front line, been mixed in with any dismounted knights (typical of Anglo-Norman and later Northern communal armies) or formed the rank behind them. This carving of militia in the Basilica of Saint Zeno in Verona illustrates the basic principle. The front rank is heavily armoured and is likely made up of the wealthiest citizens (or men hired by them), while the second rank is made up of less heavily armoured spearmen, and further back you have the men with swords and bows.
While wealthy men could hire substitutes if they wished, social obligations in medieval society scaled with people's wealth, and one of these obligations was to fight. Especially in the towns, hiring a substitute when you were fit and able to fight would be seen as dishonorable and violation of the unspoken contract. Even in the rural areas, wealthy peasants quite often took the role of vintenar (leader of 20 men) and centar (leader of 100 men) on themselves, even if they lacked prior military experience.
Edit: you might also be interested in a previous answer I wrote a little while back on the dynamics of medieval warfare, which might help you better visualise how the fighting was carried out.
Bibliography
Follow up: I was reading somewhere that battles disengaged after n% casualties, with the winner being the side that held the field. Is this even true? How did disengagement work? How was % damaged assessed?