To rejoice in another's prosperity is to give content to your lot; to mitigate another's grief is to alleviate or dispel your own.
When you truly give up trying to be whole through others, you end up receiving what you always wanted from others.