Leo the UWDA actually is affected by how many units of the various troops you put into the mix. The % of units X their weight. That way the exact army mix determines who soaks up how much hits - and no damage vanishes. Theres a wobble built in for variability.
Here's a simple example:
10 Infantry (weight 3, defense 10 each)
10 Archers (weight 2, defense 10 each)
5 Knights (weight 1, defense 10 each)
180 points of incoming attack damage to allocate.
Unit / Count / Weight / Total Defense /Share of Damage / Damage Taken / Units Killed
Infantry 10 / 3 / 100 / 60% / 108 / 10
Archers 10 / 2 / 100 / 30% / 54 / 5
Knights 5 / 1 / 50 / 10% / 18 / 1
Total weighted value = (10×3) + (10×2) + (5×1) = 55
Infantry’s share = (30/55) = around 55%, Archers = (20/55) = around 36%, Knights = (5/55) = around 9% (with a little fluctuation from randomness)
Damage is divided proportionally, then divided by each unit’s defense to calculate kills.
Overkill spill may kick in if any unit type dies off before using up its full share, redistributing leftover damage.