To stun is to knock unconscious or to shock. So getting hit in the head with a softball will stun you, but hearing that your favorite band is playing at the prom will also stun you.
If your cat catches a mouse, it may only stun the little animal and give you a chance to set it free. Being knocked hard enough in the head is generally what it takes to physically stun a person. It’s more common for something that’s astonishing to stun you, whether it’s hearing terrible news or seeing something amazingly beautiful, like the northern lights or the Grand Canyon. Stun, in fact, shares a root with astonish.