Following the decisive victory over Midian, Moses confronts the returning soldiers with righteous anger. The Israelites have spared the Midianite women, the very individuals who recently lured the nation into the devastating sin of Baal Peor. In response, Moses issues a severe and uncompromising decree to execute two specific groups among the captives: all males, including children, and all mature women.
The decision to execute the male children prompts various explanations. Some view this as a sweeping national retribution, a measure designed to ensure that no Midianite lineage survives and to exact a penalty for the grievous sins of their fathers [ספורנו, רא״ש]. Others suggest that the profound cultural and moral corruption of Midian was inherently deeply rooted in the male population, whereas the young girls could still be salvaged from this toxic environment and raised in purity [רש״ר הירש]. A third perspective attributes the execution of the male children to a critical need to preserve the moral integrity and public image of the Israelites. Had the soldiers executed only the women, onlookers or even the Israelites themselves might have suspected that the women were initially spared out of lust. Furthermore, they might have questioned the justice of the decree, as males typically faced harsher wartime punishments. By executing the young, harmless males, it became undeniably clear that the action was not motivated by human desire or conventional logic, but was an absolute decree of divine justice from God [כלי יקר, חתם סופר].
The second group condemned to death consists of women who had known a man. A minority of commentators interpret this literally, identifying them as the mature, married women who actively seduced the Israelites [העמק דבר, אם למקרא, ביאור שטיינזלץ]. However, the primary approach among commentators is that the decree applies to any woman physically capable of intimacy, generally understood as having reached the age of three. This is deduced logically from the subsequent instruction to spare only the young girls who are entirely incapable. Any girl who had reached this stage of maturity was presumed to have already absorbed the deeply corrupt Midianite culture, thereby posing an ongoing spiritual threat [רש״י, תורה תמימה, ריב״א, גור אריה, חומש קה״ת ועוד].
To accurately determine which of the female captives met this criteria, the Israelites relied on a miraculous procedure. The women were brought before the High Priest's golden headplate, which bore the engraving "Holy to God." This sacred object, representing the sanctity of the covenant and possessing the power to atone for sins of promiscuity, acted as a divine lie detector. As the women stood before the sheer holiness of the headplate, the faces of those who were physically mature would miraculously turn green, clearly identifying who was to be executed [רש״י, רבנו בחיי, כלי יקר, אם למקרא, בכור שור].
The execution of these two groups unfolded on different timelines. The males were put to death immediately and without hesitation. The women, however, could not be judged instantly; their execution naturally required a delay until they could undergo the miraculous sorting process [חזקוני, גור אריה, משכיל לדוד, כלי יקר]. The distinct separation of these orders ensured there was no tragic misunderstanding that would lead to sparing the mature women alongside the young girls [רש״י בשם ר׳ ישמעאל, רבנו בחיי, אור החיים, רא״ש]. Ultimately, carrying out these specific executions was an absolute positive Commandment, standing in stark contrast to the strict prohibition against harming the innocent young female children [דברי דוד].