Mudita means Empathetic Joy, being empathetically aware of another’s good fortune, experiencing a joy that aligns itself with that other joy. So we are happy because another person is happy. ‘Altruistic (or sympathetic) joy’, is one of the 4 sublime abodes (brahma-vihāra).
Genuine mudita is unconditional. We’re not happy because we may benefit from someone else’s happiness; we’re happy just because we understand we are all beings deserving happiness, and like others to be happy.
That’s the opposite of Schadenfreude, the pleasure derived from the misfortunes of others