This is just a stub; I will fill this essay in when I have clarified my thoughts on this topic.
If an action of a creature makes the affective state of a being worse, it is said to have done affective harm to that being.
The harmed being may be able to repair its affective state by causing some harm to the creature that harmed it. Such a reaction is called retribution. This appears to work by the originally harmed being observing that both beings have now suffered what appears to be equivalent amounts of harm, thus providing one form of justice.
If the creature doing the harm is also a being, and the harmed being decides, possibly at the cost of not repairing its affective state, not to require retribution but to dismiss the harm and restore the previous relationship with the harming being, the harmed being is said to have forgiven the harming being.
Forgivingness (also called mercy) is regarded as better than retributive justice. The simplest reasoning for this is that less harm is involved overall.