Each stronghold level starts the attacker and defender with a certain morale meter value. Each unit that dies, as stated above, reduce the meter by a predetermined amount. The formula to calculate how much a unit will remove from the meter upon death:
(Train Crop Cost + Train Wood Cost + Train Gold Cost * 2 + Train Iron Cost * 2 + Train Labor Cost * 50) / 100. (For example, a level 1 swordsman will reduce the meter by 0.7 points when he dies, since he costs 40 food and 30 wood.)
If the attackers are unable to reduce the defender's morale meter to 0 when the battle ends (the attackers either retreat or all die) then: the defenders maintain control, the gate goes back up to 50%, the meters are reset for the next battle, and the process returns to the first step where any tribe can attempt to destroy the gate.
For morale meter value for each stronghold level see the Battles section of the design document.