Reading Masha Gessen's look at Russia "The Future Is History."
Russian sociologists began studying notions in the West that were not spoken of under Communism.
One was the distinction between Envy and Jealousy.
Envy: I want what he has.
Jealousy: He has what should be mine.
Envy can be productive. It can drive someone to work harder and smarter to get what they want just as the other guy got it. Instead of one person with X, it can produce two with X at no loss ( wealth creation is not a zero-sum game. )
And, to your point; envy of another's happiness can lead to emulating not just material ambitions, but also lead to folks joining in kind acts to produce the warm fuzzies in themselves that they see in others and desire to experience.
Jealousy, OTOH, is destructive. It sees a zero-sum. It fantasizes imagined wrongs. And, as destruction requires less energy than creation; can just as easily resolve the discomfort by destroying the goods of the neighbor so one isn't reminded of the difference. ( See all the current talk of the badness of income inequality that ignores the manifest improvement of lives across the spectrum. "A rising tide lifts all boats, but his boat is rising faster than mine. Stop the tide." )
Getting thanked--ie. recognized for a charitable contribution--is generally viewed by many of the world's faiths as a detraction from the good of the act. Anonymous charity given for its own sake is superior.
( And, in the wake of # MeToo and the stripping of names off of Ivory Towers, might it not be better to remove the gift from the identity of the giver? After all, in the 23rd century, when they learn about the organ that allows us to extract oxygen just by drinking, they will want to undo all the social good done by those genocidal "breathers" who unnecessarily killed creatures. )