- Schadenfreude is a compound of the German nouns Schaden, meaning "damage" or "harm," and Freude, meaning "joy," so it makes sense that schadenfreude means joy over some harm or misfortune suffered by another.
Friedrich Nietzsche once said, “Humor is just Schadenfreude with a clear conscience.” Nietzsche suggested that the emotional pain people feel about their in-group's inferiority results in the pleasure of schadenfreude when a successful out-group fails. Subsequent research has supported the notion that schadenfreude has more to do with the inferiority of the self rather than the success of others. Nietzsche also thought that schadenfreude served only as a temporary panacea for the pain of domain inferiority.
link
Psychologists view schadenfreude through the lens of three theories. Envy theory focuses on a concern for self-evaluation, and a lessening of painful feelings when someone perceived as enviable gets knocked down a peg. Deservingness theory links schadenfreude to a concern for social justice and the feeling that someone dealt a misfortune received what was coming to them. Intergroup-conflict theory concerns social identity and the schadenfreude experienced after the defeat of members of a rival group, such as during sporting or political competitions.
....
Concerns of self-evaluation, social identity and justice are the three motivators that drive people toward schadenfreude. What pulls people away from schadenfreude is the ability to feel empathy for others and to perceive them as fully human and to show empathy for them.
Ordinary people may temporarily lose empathy for others. But those with certain personality disorders and associated traits -- such as psychopathy, narcissism or sadism -- are either less able or less motivated to put themselves in the shoes of others.
link