I think it's mostly about staying in formation. If some spearmen are attacked and are in guard mode, they will keep their spare formation, if they are not in guard mode, they will spread out as usual and run toward enemies to attack them.