If the court awards the garment to your adversary, sing a happy tune as you leave (Sanhedrin 7a).
Someone who loses even a substantial amount of money as a result of a drop in the value of the stocks that he or she owns will not be upset as intensely or for as long a time as if he or she had lost a much smaller amount of money in a court. The reason? In the first instance, although he lost, no one else won. In the latter case, his loss resulted in his adversary's triumph, and that hurts more.
Here, two plus two does not equal four, but much more. If one's loss and the other's gain had occurred independently of one another, the reaction would not have been as great. The fact that another person gains something should not be distressful, since one should be able to fargin (see 14 Tammuz). The fact that one has lost, while unpleasant, usually does not provoke so extreme a reaction. But if the two come together, and the other person's gain comes as the result of one's loss, two plus two suddenly equal a million.
Competition exists in law, business, sports, and many other events. Life is full of situations where one wins and the other loses. Unless we learn to restore the equation to its arithmetical equivalent, so that the whole should not be greater than the sum of its parts, we are in for trouble. Inability to gracefully accept a loss in competition may result in severe emotional stress and cause not only interpersonal and behavioral consequences, but may also take a severe toll on one's health.
The Talmud is right. If you lose at competition, walk away singing.