Generally speaking, the Torah does not encourage vengeful acts. There is an explicit prohibition in the Torah against exacting revenge, and, according to some, even harboring vengeful feelings (see commentaries on Vayikra 19:18, especially Rav David Zvi Hoffman). Of course, we are not meant to turn the other cheek. If a person has been wronged, he should seek justice through due process. The literal translation of “eye for an eye” is rejected for a more tempered, compassionate mode of compensation.
It is therefore puzzling that we are commanded to take revenge in the war against the Midianites. As we recall, the Midianites sent their daughters to seduce the Jewish men into worshiping idols, causing the wrath of Hashem to pour out upon us. Now it is our turn. “Avenge the Israelite people on the Midianites” (31:2), we are commanded by Hashem. The very word that is shunned by the Torah, נקמה, is used here as a positive commandment. How could Hashem encourage us to seek vengeance against the Midianites for their ruthless plan to destroy us, when at the same time we are commanded to eradicate the desire for revenge from our hearts?
A possible approach to this question is to distinguish between revenge and justice. Justice is a universal virtue. Justice is allowed, but revenge is not. Perhaps to fully understand this approach we would need to clarify the difference between revenge and justice. However, even if we understood the difference between the two ideas, the Torah clearly calls the war against the Midianites revenge (נקמה), not justice (משפט). Why is this case of revenge allowed while other cases of revenge are not?
A comment of the Chizkuni may shed some light on this question and on the Jewish attitude toward revenge in general. Commenting on the prohibition of taking revenge in Vayikra (19:18), the Chizkuni says you may not take revenge “because your anger will dominate you.” Revenge is understood by the Chizkuni as stemming from a deeply personal need to vent anger. Presumably, justice is distinct from revenge in that justice involves due process in a rigorous, reasoned, collected manner. A personal vendetta is revenge, but a trial is justice. Revenge is prohibited because it could easily spin out of control. Often, people who seek vengeance go above and beyond what justice calls for. The mafia approach of going after not only the informant but also after his family is revenge, not justice, because it stems from an emotional burning, not from a sense of right and wrong. In such a case, justice is twisted while revenge is served.
Now we can understand the Torah’s approach to revenge. As a general rule, revenge is prohibited because the anger involved could easily spin the avenger out of control, causing him to go far beyond what is just. There is only one exception to this prohibition. When Hashem Himself commands us to take revenge, there is no danger of things getting out of control. Since the root of our actions is Hashem’s command and not personal anger, we are not in danger of losing control. The war against Midian is still called revenge, not justice, because it serves to vent anger, but it does so in a way that is controlled by our obedience to Hashem’s commands, thereby exacting justice and vengeance at once.
It is vitally important that we view the vengeance taken against Midian as a one-time event, sanctioned only because of a direct command from Hashem. In the absence of such a command, the victim must always seek justice through due process, through well-reasoned decisions made by respected people who desire not to calm the flames of anger but to balance the scales of justice.