Sympathy is "I understand how you feel" Empathy is "I feel how you feel" Compassion is "How do you need me to help?"
Compassion and pity aren't the same thing at all.
Before we talk about compassion, let's first talk about empathy.
Human beings are born narcissistic little monsters (hear me out first). It has survival value. We cry when we're hungry. We don't know or care that mom might be asleep or busy or whatever; in a literal sense, we are capable only of thinking of and responding to our own needs. We are, as infants, not even capable of realizing that other people have needs, desires, or an internal life.
Over time, ideally, we learn empathy. Empathy is the ability to understand that other people are just as real as we are, to understand that other people have needs and desires, and to be able to imagine what it is like to put ourselves in someone else's shoes and see things from their perspective. As we grow up, it becomes natural to most of us, but only to a certain point. Most people never become really good at it. We empathize with people we like, or people who are part of our group. We don't empathize with people we don't like.
Compassion is the ability to put ourselves in someone else's shoes, imagine things from their perspective, and then to feel kindness for them and seek understanding of them even if what they do is harmful to us, goes against our needs and desires, is at odds with our own experience, or hurts other people. Compassion is empathy on steroids. It's the ability to understand the view and perspective of someone we don't like, or someone who is doing something we think is bad.
Compassion requires that we have good personal boundaries--that is, that we are able to advocate for and defend our own needs. If you can put yourself in someone else's shoes and view them with kindness and understanding even if their needs are contradictory to your own, but you can't assert or advocate for your own needs, you risk allowing them to take advantage of you, or becoming codependent. Compassion lies in viewing someone in the best possible light, understanding their needs, looking upon them with kindness--all without allowing them to manipulate, control, or abuse you. You have to be able to understand and even value someone else's perspective without becoming a doormat. The most compassionate people tend to have the best boundaries.
So the essential prerequisites of compassion are empathy, boundaries, and the willingness to see others in the best possible light even when they are being hurtful. Not an easy combination, which is why so few people are compassionate.
An example of compassion is compassion for an abuser. Most people will say things like "a guy who abuses his wife is a monster" and "abusers are just bad people." The truth is, abusers aren't monsters. They're human beings. And abusers don't abuse because they wake up one day and say "Hey, I know what I want to do today! I want to become an abuser!" Abusers abuse because they are in pain. They are looking for an answer to their pain, and the answer they come up with is control. They abuse because they need control. They need control because they are suffering.
Empathy is what allows you to imagine yourself in the abuser's position. Compassion is what allows you to understand that an abuser isn't a monster; an abuser is a person who is in genuine pain. Boundaries are what allow you to assert that the abuser should not be excused because of it; that yes, the abuser is in pain, but abuse is not okay, and the abuser must still be held accountable for it.
So why do any of this? Why would you want to understand the perspective of someone who is doing something harmful?
Because compassion is what stops YOU from doing horrible things.
To an abuser, controlling others seems like a reasonable way to deal with his fears, pain, and insecurities because the abuser is acting without empathy or compassion. The abuser does not put himself in his victim's shoes. The abusers feels pain when the victim doesn't obey his control, but the abusers does not look at the victim with kindness and understanding. The abusers does not try to comprehend the victim's needs, nor understand why the victim is resisting his control.
People who say abusers are monsters are wrong. If you reassure yourself that only monsters abuse, and you tell yourself that you are not a monster, you will conclude that clearly that means you are not an abuser... even if you abuse others! Compassion is a tool that reminds us that other people are similar to us, and that means we are capable of great evil if we do not watch ourselves carefully. Abusers do not believe they are monsters.
Many abusers see themselves as victims, not abusers. Compassion is the tool that lets us avoid that mistake. It is the thing that allows us to connect with other people in ways that help promote treating them without malice.