What happens if I get 5v in an output pin?

Retrofly:

I have an LED I hooked up mentioned above. I can turn it off by setting the pin LOW (short to ground). I can turn it on by setting the pin HIGH (short to 5v).

What exactly is that digitalPin seeing when I set it HIGH. It's attempting to give out 5v right? At the same time it's getting in 5v from the cathode of the LED.

Semi-related, what would happen if I hooked 5V directly up to a digitalPin in output mode set to HIGH.