A free mod for Mount & Blade II: Bannerlord, by BoiZoi.
Fight to the End is a simple mod that stops units from fleeing while in battle. It does this in a couple of ways:
In the first way, it prevents all units from fleeing. So, for example, if you have an army of orcs, and you fight against the enemy, and some of your orcs flee, then the enemy will be able to attack your base.
In the second way, the mod is configured to allow you to set a config.json file that can be edited to modify the variables that are used to calculate the amount of morale gained or lost when a unit is in battle. So, for example, you can set the lost morale multiplier to be higher or lower than the gained morale multiplier. This means that you can change the amount of lost morale when a unit is in battle.
The config.json file can also be edited to set the gained and lost morale multipliers for all units, or to set them for just one unit.