Aliya Summary: The Israelites are commanded to exact revenge from the Midianites for their part in seducing Jewish men to sin (described in the end of the Torah reading of Balak, Numbers 25). A 12,000-strong army of Israelites, led by Pinchas, waged battle against Midian. All adult Midianite males were killed, along with Balaam and Midian’s five kings. The women, children, and battle spoils are brought back to the Israelite encampment.
Rashi explains that the reason why revenge is to be taken against the Midianites and not the Moavites, even though they both attacked us, is because the Moavites attacked out of fear of being attacked by the Jews, while the Midianites attacked unprovoked. The same actions are treated and understood differently, and treated differently, based purely on intent. We all judge others based on their actions, but G-d judges us based on our intent, too.