You feel guilty when you did something that caused harm to someone, for which you hold yourself (partially) responsible1. For example, you can feel guilty when you break a precious vase at someone’s house, or if you accidentally tell the birthday girl about the upcoming surprise party in her honor.
Feeling guilty is often associated with moral transgression, i.e., committing a crime or a sin. However, it is important to distinguish feeling guilty (as an emotional experience) from being guilty (as a legal or moral judgment). Someone may have committed a severe crime and be tried as guilty, without ever feeling any guilt2. The opposite can also be true: a person can feel guilty when, rationally speaking, they haven’t done anything wrong and are not held responsible by anyone3. For example, imagine you invite a friend to come over, and on the way to your house she has a serious accident. Although no one blames you, as you had no way of knowing this would happen, you can nevertheless experience a great deal of guilt. When this happens, you basically mistake a causality – if you hadn’t invited her, she would still be alright – with a responsibility – that you could somehow have known or done something to prevent it4.
People who feel guilty often have the urge to undo or repair their wrongdoing, for example, by refunding the financial damage. If the damage is irreversible (e.g., if something unique has been destroyed), or if someone else’s trust has been irreversibly betrayed, the guilty person may instead try to atone for their wrongdoing, i.e., by punishing themselves. Thirdly, if someone feels guilty for doing something wrong that other people don’t know about, they will have an urge to confess what they did. In all three cases, the explanation seems that the guilt-feeling person wants to demonstrate that they are not a bad person, but merely a good person who did something bad.
In the comic, Murphy accidentally spills his lunch over a co-worker, ruining her outfit.