Joy (muditā) is similar to compassion, but different; it is what goodwill (mettā) feels like when we encounter those who are happy rather than those who are suffering.
What can joy be a remedy for? Craving gives rise to jealousy, envy, and greed in all of its manifestations. When muditā is practiced and developed, it becomes a “sublime” and “boundless” state of mind to be “dwelt in” as a corrective for the removal of mind states based on craving.
It is these three fires [greed, hatred, and delusion] that give rise to jealousy, envy, covetousness, avarice, and greed. The craving for possessions, the craving for sensual pleasures, the begrudged success of others, the hatred that is begotten by the gains of others, the odious comparison of greater status compared with our humble circumstances, these are the “fires” that burn within us to our undoing…. Unselfish joy multiplies in ratio to the extension of its application, quite apart from its purifying effect on our own lives. https://www.accesstoinsight.org/lib/authors/various/wheel170.html (page down to Mudita by C.F. Knight)
Most of us find it easier to feel compassion than appreciative joy because compassion usually registers more strongly with us; joy is quiet. But in order to cultivate wholesome mind states, in order to balance our sensitivity to suffering, we can’t overlook muditā; we have to seek it out. Once we start noticing when someone is joyful, and registering what our natural reaction is, we can find the place in our hearts where we are uplifted by another’s good feeling. If there’s (ego-driven) envy, we can let it go. The habit of recognizing and appreciating someone else’s joy enables us not only to grow in this boundless state that the Buddha praised, but we will also notice how peaceful this mind state is.
From Ajahn Sucitto’s article Muditā: Sharing in Joy:
Muditā means ‘appreciative (or empathic) joy.’ It’s the happiness that arises from appreciating other people’s (or one’s own) good fortune. It comes from acknowledging the basic happiness, the freedom from pain, fear or grief that all beings seek. It can be sensed as the buoyancy that occurs when we touch into well-being or whenever a difficulty ceases – even temporarily. …
It’s good to consider what gets in the way of this natural joy. Factors such as perfectionism, performance drive and goal orientation will have the [inner critic] side effect unless they’re balanced with appreciation. Meditation itself gets tense when we expect results and neglect a sense of appreciation. So it’s important to cultivate a sense of respect for the aspiration and commitment that gets us to meditate in the first place. I generally advise meditators to reflect and dwell on the goodness that is already there in terms of ethical sensitivity and integrity, and let the heart fill with that at the beginning of a meditation session. Effort requires nourishment: it’s the common sense measure of putting gas in the tank when setting out on a journey. [https://commongroundmeditation.org/wp-content/uploads/2018/01/Mudita_-Sharing-in-Joy-by-Ajahn-Sucitto.pdf]