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.
The idea in The Man that Would Be King was that the music should recreate all that majestic surrounding and emphasize the adventure, but also speak about the frustration or, rather said, the curse of both protagonists, even before happened what happens them.

