I don’t believe that justice and revenge are ever the same thing. As a society, we like to think that we value justice as a virtue, but there are plenty of times when, say, someone gets off on a technicality and we collectively groan because, though the result was to the letter of the law, it was not just. Rather, as a society, we can only value law, which we hope is generally a social concensus on what we all believe justice to be. But I don’t believe justice requires any social or government aspect to exist.
Instead, how I think of justice is an attempt to restore balance and equity to the situation. To accomplish this, there are two aspects that must be considered. On the part of the wronged, what is most just is to restore him as closely as possible to the state he would be in had he not been wronged. On the part of the offender, he should be punished in a manner that is equitable to the amount that he wronged the other person. These goals are seldom possible to achieve perfectly, so we have to make certain concessions. For instance, if a person is injured, we will tend to compensate with a reasonable amount of money on the part of the offender. Similarly, we may consider certain acts of an offender either too barbaric or just plain impossible to return, and so we have some other method of punishment. The closer we can get to accomplishing these goals, the more just it is.
The goal of justice is not to prevent recidivism, or rehabilitation, or protecting the population. Those may or may not be laudable goals, and they are often considered along with justice and can get confused with it, but they are not part of jusice directly. For instance, those three goals are a good reason to favor imprisonment for many crimes over corporal punishment or simple restitution. But I believe it is, in some cases, less just to do things to further those goals, but that doesn’t necessarily mean that it is a bad thing.
Revenge or vengence, on the other hand, is taking one (or both) of those aspects of justice, particularly the punishment aspect, farther than is equitable. For instance, I would argue that it is equitable that if someone punches me it would be just–though a terrible idea, as I don’t believe that this concept of justice is above all other virtues–to punch him with equal force. I would be also quite justified to pursue other means of justice, such as pressing charges. I think that that avenue would be technically slightly less just but would further other laudable virtues, such as social order. That said, what would be an act of revenge would be to consciously strike him back harder than he struck me, or to press charges and knowing seek a harsher prenalty than the act rightfully deserves.
So all of that said, I think there are situations where we can see various combinations of legality, justice, and vengence as examples to help illustrate how I see these concepts. So, for example, we could take a typical burglarly law as an example of legal justice. But there’s also plenty of legalized forms of revenge, such as particularly harsh penalties for drug related offenses. I also think there are times that the law fails to mete justice, it’s a bad idea for other reasons to go vigilante for it, but I don’t think vigilantism is necessarily unjust. Or it can be something as simple as organizing protests, boycotts, or social awareness. And, of course, extralegal vengence, like assaulting/killing a cheating spouse.