How do voltage regulators fail?

I remember doing that with a 7805, back then I didn't even think about power dissapation, was wondering why it would get red hot at 12 input and 1a draw lol