The real meaning of this saying is that you yourself will benefit from acts of compassion toward others. I came to understand the real meaning of this saying when I became aware of positive power.
Pleasing your mind and putting yourself in a cheerful state without anxiety will improve your spiritual level. Compassion or sympathy toward others will bring more happiness not only to others, but also to yourself, which will increase your positive power.