Embarrassment is a painful but important emotional state. Most researchers believe that its purpose is to make people feel bad about their social or personal mistakes so that they don't repeat them (thus benefiting the larger society), and its physiological side effects—like blushing, sweating, or stammering—may signal to others that someone recognizes their error and is not cold-hearted or oblivious. In fact, studies have shown that people who act embarrassed after committing a “bad act”—like knocking over a store display—are perceived as more likable than those who don't, regardless of whether or not anything is done to make amends for the mistake.
Someone can also feel embarrassed on behalf of other people, a phenomenon known as vicarious embarrassment. Shame is another "self-conscious emotion" in the same category as embarrassment; it’s often deep-seated and related to self-esteem, and can be felt even when no one else knows about real or imagined slip-ups. Guilt is a similar emotion to both shame and embarrassment, but unlike either, it tends to focus specifically on what one has done, rather than who one is.