The Prophet Balaam told King Balak that the only way to harm the people of Israel was to seduce them into sin. For only then would G‑d punish His people.

The kings of Moab and Midian acted upon this shrewd advice of Balaam. They arranged a big feast in honor of their idols and invited the children of Israel to participate in the ceremonies. Many of the Jewish people fell for this ruse and participated in these heathen celebrations. Amongst them was Zimri, a prince of the family of Simeon, who was not ashamed to let the entire Jewish community witness his evil conduct.

Phinehas, the son of Elazar the high priest, was among those who saw Zimri's shameless conduct. In his zeal to defend the honor of the Torah, he took a spear and entered Zimri's tent. Finding the ignoble prince in the company of the daughter of a Midianite prince, he killed them both with one thrust of his spear.

By this brave act, Phinehas stopped the plague which had begun among the children of Israel, and which had taken a toll of many thousands of dead among those who had allowed themselves to be seduced by the Midianites.

Phinehas' action was rewarded by a Divine covenant of peace and everlasting priesthood.

Following the outrageous attempt by the Midianites to seduce the children of Israel into sin, G‑d ordered Moses to declare war against the Midianites and smite them. In the ensuing battle not only did the five princes of Midian f all with their vanquished troops, but also Balaam, the instigator of all this trouble, was slain.