The divine command to wage war against Midian serves as a severe response to a devastating spiritual attack rather than a mere physical threat. The primary approach among commentators is to explore why this directive targets Midian exclusively, while Moab, who was also an active participant in leading the Israelites into sin, was spared from punishment. Several fundamental differences distinguish the two nations. First, Moab acted out of a natural and justified fear of Israel's growing military might, whereas Midian was driven by pure, unprovoked hatred [חומש קה״ת, חזקוני]. On a practical level, the Israelites themselves initiated the transgression by wandering into the Moabite tents. In contrast, the Midianites acted with calculated cunning. They willingly sacrificed their own daughters, including royalty, actively infiltrating the Israelite camp to seduce the men with wine and immorality [כלי יקר]. They even magnified their offense by specifically targeting the nation's leaders and most righteous individuals [אלשיך]. Additionally, while Moab appears to have ceased its actions following the plague, Midian continued to plot, remaining an ongoing threat [רלב״ג, מנחת עני]. Ultimately, Moab was spared because of its historical destiny: from this nation would emerge Ruth the Moabite, the matriarch of the Davidic dynasty [רבנו בחיי, חומש קה״ת].
The extreme reaction against Midian stems from the perspective that causing another person to sin is far more severe than killing them. While a murderer ends a life in this physical world, one who leads another into sin robs them of both this world and the world to come [צאינה וראינה, אלשיך]. Consequently, the Midianites are classified as deadly pursuers. They fall under the strict principle of self-defense, which dictates that if someone comes to kill you, you must act first to strike them down [רבנו בחיי, מנחת עני].
The directive to maintain hostility against Midian represents a constant, unending obligation rather than a one-time event [רש״י, אבן עזרא, גור אריה, מזרחי]. Initially, this was not a call for immediate warfare, but rather a psychological remedy for the Israelites. In order to uproot any lingering lust and attraction to their recent sins, the people had to cultivate a deep resentment and absolute disgust toward those who had engineered their downfall [אור החיים, חזקוני]. Tactically, the instruction was to harass the Midianites, restrict their movements, and break their strength long before the actual battlefield clash [העמק דבר, רש ר הירש]. Furthermore, this command completely suspended the standard biblical laws of warfare. While the Israelites were normally obligated to offer peace before a siege and preserve fruit-bearing trees, here they were instructed to withhold any offers of peace and intentionally destroy the enemy's trees and water springs as an act of retribution [אור החיים, מלבי״ם, בעלי ברית אברם].
The responsibility for this conflict is divided between Moses and the people. The initial command to harbor hostility is directed personally at Moses. Because the Midianite king explicitly ordered his daughter to seduce only the greatest leader of Israel, Moses is personally tasked with spearheading the enmity against them [הטור הארוך, קיצור בעל הטורים]. However, the actual physical warfare is assigned to the entire nation for a later time. Moses, having grown up in Midian and benefited from their hospitality in his youth, is morally prevented from striking them himself [אור החיים, הטור הארוך, קיצור בעל הטורים, העמק דבר]. When the nation finally does engage in battle, they are commanded to deliver a decisive blow. In stark contrast to standard rules of combat, they must surround the Midianites from all four sides, leaving absolutely no avenue for escape [מלבי״ם].