The philosophy that happiness is the best revenge stems from the idea that being a happy person is better than being an unhappy person, which effectively makes you the better of the two people in question. The logic of this philosophy requires that two main assumptions hold true.
It first must be assumed that the person you are getting revenge on is someone who is miserable with at least one aspect of their life. The misery is what drives the person to wrong other people in some fashion. For example, I know of a woman who was deeply unhappy with her love life; she felt that her partner was not giving her what she needed. She felt that she was a victim of her relationship. She eventually sabotaged her own relationship as well as another couple's relationship by having an affair. She told me that the married man she slept with was unhappy in his relationship, and it was his partner's fault for not giving him what he needed. In her mind, it was okay for him to cheat on his wife because he was a victim. In psychological terms, she was projecting her own thoughts and feelings onto other people and acting accordingly. It can therefore be argued that people who do immoral things are doing so because their own negative emotions are distorting their thoughts and behaviours in a negative way. If someone has done something wrong, it is possible that it is because they're unhappy.
The second assumption that must hold true is that being happy is in fact better than being unhappy. Such an argument is based entirely on abstract terms. The definition of happiness varies between cultures or according to individual values. Whether happiness is better than unhappiness is a matter of perception. It has been said before that perception is everything; the way that you see the world determines your own personal truths. It can thus be argued that there are many people who prefer to be unhappy. For example, at every company I have worked at to date, there has been at least one person working there who complained about their job or the company, yet made no effort to leave. It sure seems like they enjoy being unhappy. The problem with such an argument is that not everything is what it appears to be. There is an explanation that such people are stuck in a rut and secretly yearn to be happy. Happiness is a highly valued trait to possess, and it is reflected in North American society. There are dozens of books for sale that outline the secret to personal happiness, and antidepressants are a common prescription. The evidence strongly suggests that being happy is better than being unhappy.
With both assumptions holding true, it can be concluded that being happy is better than being unhappy, and people who treat others badly are unhappy people. Therefore, happiness is the best revenge. Being happier than your enemy means that your life is better than theirs, and instead of being angry with such people, it is better to be thankful that you're not like them.
A word of caution is needed, however, for there is a risk of feeling happy about someone else's unhappiness. Taking pleasure in the fact that you feel happier than someone else is a logical fallacy. It begs the question of how happy you really are as a person if you take pleasure in another person's personal pain. Happiness is only the best revenge if you learn to view your enemy with understanding rather than with contempt.