Every time a unit is attacked or prevents an opponent from attacking through repelling, it gets a point of harassment penalty. Each point of harassment penalty reduces the unit’s defense by 1. The penalty is multiplied by 95/100 every 320 ticks (or 23.4375 times a round)1), so the penalty goes down quickly if it is high and the unit is no longer being attacked.
A weapon with multiple attacks inflicts 1 point of harassment penalty for each one of its multiple attacks.
Mounted units are only half as affected when defending, suffering only half of their harassment penalty (rounded down). A mounted unit completely surrounded by 3-per-square, 1-attack-per-turn units bottoms out at -12 defense harassment penalty. Note that the harassment penalty for repelling is not halved.
A unit with Unsurroundable will receive a reduced harassment penalty from being attacked multiple times in a round. Eg. Unsurroundable(3) means a unit can be attacked 3 times before receiving any harassment penalty.
Harassment replaces Multiple Attack Penalty in previous iterations of Dominions