There are a lot of emotions that arise in the face of suffering. Despair, anxiety, sadness and so on. But with compassion the mind takes the vision of freedom from affliction as it’s object, creating a positive even joyful state.