Really? First of all, I think you need to study your history. Slaughtering your enemies to the last many is by far the exception (e.g, The Alamo).
To the last, yes that was pretty unusual, but slaughtering routed enemies as they try to get away was prettymuch standard practice. They're suddenly much easier to kill and doing so is much less risky to yourself, personally. But, sure, you get tired or see something worth looting on a body... so not /all/ of them.
So, really, you're both right. Routed troops tended to suffer heavy casualties as they stopped fighting & ran. And, exterminating the other side was rarely a strategy in warfare. (Indeed, convincing the enemy they'd have to - that you'd "fight to the last man" - would probably prevent or at least delay the battle, if you could sell it.)
Bear in mind that the word "decimate" literally means that 1 in 10 was killed, and yet it has become a word we associate with utter destruction.
And, it's not even derived from casualties suffered in battle. It was a Roman punishment for a unit that failed. So when a Legion was "Decimated" it didn't necessarily mean the enemy killed a lot of 'em (or any of 'em), but that they failed horribly and were punished for it.
But more importantly, I wasn't talking about the concept of killing all of your enemies, I was talking about the game strategy of killing things just to get experience points. (Maybe the medieval warriors you are thinking of killed defeated enemies to improve their sword skills?)
Agreed, if the game were realistic, you'd improve your skills mainly by training. Experience could also help you improve in applying your training, gaining confidence, etc...
Yes, this was the point I made earlier. Most RPGs, and very much so 5e, are not very "dangerous", so combat is fun and in general desirable because of XP. If you actually ran the risk of getting maimed or killed you'd be more reluctant to start a fight, and more willing to accept surrenders or let survivors flee (mitigated situationally by the risk of them coming back with friends, of course).
Player buy-in to the role can be a significant factor in that kind of thing. D&D traditionally has a lot of PC behaviors that are the result of the players & rules being the way they are, that don't always match up to RL behaviors, let alone Heroic Fantasy behaviors. Combat can be as dangerous as you like, and to a point, it might get players to make their PCs take fewer risks (fight fewer combats, try to engineer overwhelming advantage when they must fight, give up adventuring and open a pawn shop*, whatever), past that point it might cause them to divest from their characters and treat them more like pawns. But if you do get buy-in, players caring about their characters, the NPCs, the focus of the campaign, etc - they might deliver some more realistic, or at least genre-appropriate, PC behavior...
...maybe.
If not, buy some beer & pretzels and kill things.
* still a tad risky.