Spells and units’ special abilities that heal, stun, inflict poison or take other units under control, affect only the living warriors. Such units as Skele-archers and Spearletons, The Headless Horseman, Scarecrow, zombies, ballistas etc. are considered non-living creatures (or mechanisms), therefore they cannot be taken under control, stunned, poisoned or healed.
Complex spells with multiple effects (like damage + stun) affect the non-living partially, i.e. all units will get damage, but stun will only affect the living ones.