A lady sits home alone and the door-bell rings. She is not expecting visitors so she ignores the bell. From the window she sees a man she does not know and she decided for safety to ignore the bell for 20 minutes of ongoing ringing as she selfishly protects herself. Compassion may say that she should answer the call as this person may need help. Compassion for her says she may well be right to ignore the bell as he may have other plans. Compassion for him, even if he has evil intentions, would see that he has a past leading him to such behavior.
Sitting by with compassion for what is happening anyway and cannot be changed would leave all parties with an "empty boat" and ongoing happiness. When compassion moves to selfishness any party in any case can then move from compassion towards self-centred desire and an unhappy act will emerge. And so if it does we can be compassionate towards that as we see why it happened. We, compassionate to all events, can remain happy no matter the outcome.
Compassion without wisdom though can lead to misunderstanding the real issue and can lead to self/desire driven goals and rationales, and this is dangerous. Compassion with true wisdom will always see the whole picture and will be free of self. As a person donating to charity and picking up a receipt so they can claim a tax break is apparently different to a person helping a stranger anonymously and with no expectation of recompense.
Being compassionate to all removes you from the selfish separate (and provably illusory) self "I" and it results in scientifically and real world case proven happiness.