Stun is a temporary status that units can inflict from a variety of attacks.
When units are stunned stars appear above their heads, indicating the stun. Stunned units cannot move or attack during the duration of their stun. However, if a spellcaster is stunned while casting a spell, the spell will still be successfully cast.
In many cases the stun can be reapplied quickly after it wears off, like the repeated blows from Order Giants' stones. Thus, the escape of stunned units usually involves other units who take the stun for them or stall the blow enough for the unit to escape.