One of the worst flaws of d20-era (a.k.a. post-3e) D&D is that despite its attempts to codify mechanics for SO MUCH shit that would just be adjudicated on the fly by the GM in previous editions, they lack codified mechanics for enemy morale and I think that’s a big reason why combat encounters tend to become so drawn-out and tedious.
Like, my first edition was 3.5e and I remember the Dungeon Mater’s book had this little section about how most creatures probably wouldn’t fight to the death unless they’re like mindless undead, but it lacked any sort of advice on WHEN it might be appropriate to make creatures surrender, flee, negotiate, etc. I think 5e has a weaksauce attempt at a morale roll using a wisdom saving throw, but it’s presented as an optional rule and most people ignore those. (Also like. Even when people do decide to use it. Using a wisdom saving throw means that creatures with higher wisdom are more likely to stay and fight to the death, which is just stupid)
All pre-3e editions (OD&D, B/X, BECMI, AD&D, etc) had this really simple but cool morale system that’s still used by A LOT of OSR games, where every creature’s stat block had a morale value between 2 and 12, measuring their courage and loyalty. In combat, the GM would test morale for every enemy:
The first time they see a creature on their side die
When 50% of their group has been defeated
(This isn’t in the original D&D morale rules but a lot of OSR games add it too) When their leader is defeated.
The GM would roll 2d6 for every enemy, and if the result was greater than their morale, they’d attempt to flee or surrender. It’s simple, it’s elegant, it takes the guesswork out of when it’s appropriate for monsters to flee, and it provides an easy way to characterize certain enemies as more or less likely to stay and fight to the death.