1. Two explanations for Moav’s aggression
Parshat Balak focuses primarily on the efforts of Balak, the King of Moav, to defeat Bnai Yisrael. The above passages introduce the narrative. The Torah explains that after Bnai Yisrael overcame Sichon, Og and their respective nations, the people of Moav were overtaken by fear and dread. However, the passages do not provide a specific explanation for Moav’s intense apprehension. The commentaries offer a number of possibilities. One explanation that is quoted by many of the commentators is suggested by the Talmud. The nation of Moav believed that it was in danger of being conquered. It had observed the ease with which Bnai Yisrael had overpowered its mighty neighbors. It assumed that Moav would be the next target for conquest.
This was a miscalculation. Moav was not in danger. Bnai Yisrael did not intend to wage a war of conquest against Moav. In fact, Moav was among the three nations that Hashem forbade Bnai Yisrael from attacking. Moav had no reason to fear Bnai Yisrael.
Rashbam offers a different explanation. He suggests that Moav was not afraid of attack and understood that it was safe from aggression. However, it feared that the region could not support another populous nation. They were afraid that the replacement of the Sichon and Og’s nations with the much larger population of Bnai Yisrael would tax the productive resources of the area beyond its capacity. Moav feared that famine and hunger would soon befall it.
And Yisrael captured all of these cities. And Yisrael dwelled in all of the cities of the Emorites – in Cheshbon and its surroundings communities. (This is) because Cheshbon was the city of Sichon the King of the Emorites. He had waged war against the first king of Moav and taken his land from him – up to Arnon (Sefer BeMidbar 21:25-26)
2. The history of the kingdoms on the Jordan’s east-bank
Chizkuni offers a very interesting explanation for Moav’s fear. It is based on the above passages and Rashi’s comments. These passages are from the end of Parshat Chukat. The first passage describes the extent of Bnai Yisrael’s conquest of the Kingdom of the Emorites. This passage explains that even the capital of King Sichon was captured. The second passage then explains that Sichon had annexed to his kingdom possessions that were previously part of the Land of Moav. The two passages are related. The second passage is introduced with the word “because”. In some manner Bnai Yisrael’s conquest of this land was related to its earlier conquest by Sichon. However, the exact connection between Sichon’s earlier conquest of the area and Bani Yisrael’s subsequent conquest is not specified.
Rashi explains the Torah’s intention. According to Rashi, the second passage answers an important question. Chesbon – Sichon’s capital – was once part of the Land of Moav. It was part of the territory Sichon had annexed through his successful campaign against Moav. Bnai Yisrael were enjoined against taking possession of the Land of Moav. Yet, the first passage explains that Bnai Yisrael settled in Cheshbon and its surroundings. This suggests a problem. How could Bnai Yisrael settle in territory that was once Moav’s? They had been commanded to not enter into conflict with Moav! According to Rashi, the second passage provides the explanation. The land was originally part of the Kingdom of Moav. However, with Sichon’s conquest of the territory it passed out of the possession of Moav and was no longer rightfully its land. Therefore, Bnai Yisrael acted properly in settling into all of the territory it had captured from Sichon – regardless of its historical ownership.
3. A third explanation for Moav’s aggression
Based upon these passages and Rashi’s comments, Chizkuni explains Moav’s fears. Moav never reconciled itself to Sichon’s annexation of its territory. It continued to regard the land as part of the Kingdom of Moav but occupied by Sichon and his people. Therefore, Bnai Yisrael’s conquest of Sichon’s kingdom renewed Moav’s aspirations to regain its traditional lands. Moav hoped that Bnai Yisrael would acknowledge its ancient claim to the territory and return it to its historical inhabitants. Of course, Bnai Yisrael did not offer to restore Moav to its territories. This led to more than mere disappointment.
Moav misinterpreted Bnai Yisrael’s actions. Moav did not understand that halachah treated the land as part of the Kingdom of Sichon and not part of the Kingdom of Moav under occupation. In interpreting Bnai Yisrael’s actions, Moav focused on its attachment to its lost territories and evaluated Bnai Yisrael’s behaviors from that perspective. Therefore, when Bnai Yisrael did not offer to return to Moav its lost territories, Moav concluded that Bnai Yisrael did not respect Moav’s sovereignty. Moav assumed that with the conquest of Sichon and the retention of Moav’s traditional territories, Bnai Yisrael was announcing its intentions to take possession of all of the Land of Moav.
And Hashem spoke to Moshe saying: Distress the Minyanites and attack them because they caused you distress through their craftiness through which they deceived you in the matter of Pe’or and regarding the matter of Kazbi daughter of a Prince of Midyan – their sister – who was killed on the day of the plague resultant from the matter of Pe’or. (Sefer BeMidbar 25:16-18)
4. Hashem’s command to destroy Midyan and spare Moav
Throughout the parasha, Moav is joined in its efforts to overcome Bnai Yisrael by the nation of Midyan. Moav’s efforts eventually had some impact. It developed a plan to corrupt Bnai Yisrael and to entice a portion of the people to engage in idolatry. The plan reflected the desperation of Moav. It required sending its young women into the camp of Bnai Yisrael with instruction to seduce the men. They were further instructed to entice their victims to join them in pagan worship. The plan had some success and provoked Hashem to unleash a plague that killed 24,000 people. Midyan joined Moav in this scheme and even one of the nation’s princesses joined the young women in their seductions.
Immediately following this episode, Hashem commands Moshe to treat Midyan with enmity and to attack and destroy the nation. Of course this commandment raises an interesting question. Midyan was Moav’s partner. However, it seems from the Torah that Midyan was the junior partner in the association. It is strange that Hashem commanded Moshe to take vengeance against Midyan but not Moav.
Rashi offers a number of explanations for the different treatment of Moav and Midyan. One explanation actually acknowledges that Moav was equally deserving of Bnai Yisrael’s enmity. However, Moav was spared because the nation was destined to produce Ruth. Rashi’s second explanation is based upon the previous discussion of Moav’s motivations. As explained above, the commentators offer various explanations for Moav’s aggression toward Bnai Yisrael. However, all of these explanations share a common thread that is expressed in the opening passages of the parasha. Moav was motivated by fear. The commentators differ over the nature and cause of the fear. However, all accept the simple message of the passages; Moav was acting in perceived self-defense. Rashi explains that Midyan had no similar motivation. It had no reason to fear Bnai Yisrael. Therefore, its partnership with Moav was motivated by elemental hatred. 
5. Alternative explanations for the command to destroy Midyan
These two explanations imply very different interpretations of Hashem’s command regarding Midyan. According to the second explanation offered by Rashi, Bnai Yisrael is told to destroy the nation of Midyan because it acted out of intense hatred. However, Moav is to be spared because it acted according to its perceived self-interest. These different motivations suggest that Moav was only a very temporary enemy. It would soon come to the realization that it was safe from attack from Bnai Yisrael. Once it recognizes that Bnai Yisrael’s presence in the region does not threaten its security, it would come to terms with the new reality and accept it.
However, a détente with Midyan would not be possible. Midyan did not act out of self-interest. It was motivated by a primitive, intense hatred. This hatred would induce continued aggression. Bnai Yisrael’s security required the destruction of this rabid enemy.
However, this interpretation of the commandment does not apply to Rashi’s first explanation. According to that explanation Moav and Midyan equally deserved to be punished. Moav was spared in order to produce the righteous Ruth. According to this explanation, the destruction of Midyan is not an act of self-defense. It is intended as a punishment. Moav and Midyan both deserved punishment. Both had preferred war to seeking peace. Both attempted to provoke within Bnai Yisrael sedition against Hashem. However, Moav was spared this harsh punishment because of the good it was destined to produce.
 Mesechet Sanhedrin 105a.
 Sefer Devarim 9:9.
 Rashbam 22:4.
 Rashi Sefer BeMidbar 21:26.
 Rabbaynu Ovadia Sforno, Commentary on Sefer BeMidbar, 20:8.
 Rabbaynu Shlomo ben Yitzchak (Rashi), Commentary on Sefer BeMidbar 20:1.
 This is not to say that the Torah condones acts of aggression and conquest among nations. However, once the conquest did occur, Sichon sovereignty over the territories of Moav was established and recognized by halachah.
 Chizkuni Sefer BeMidbar 22:3.