The military campaign launched by the Kingdom of Judah against Edom was driven by a blend of spiritual, political, and economic motives. King Amaziah gathered his strength for the battle specifically because he chose to listen to the word of God [מלבי״ם]. Empowered by this obedience, he led his nation into a military invasion. The primary goal was to restrain the Edomite nation. While Edom was never a large empire and typically remained under Judean control, it occasionally claimed autonomy and appointed its own kings. Beyond simply keeping a neighboring territory in check, Judah had a vital interest in securing the region, as the Edomites controlled the highly strategic route leading to the port of Eilat [ביאור שטיינזלץ].
Marching into the Valley of Salt, Amaziah and his army struck down ten thousand Edomite soldiers. However, while the initial victory was a direct result of following the path of God, the campaign quickly devolved into actions that went against the law. The Sages criticize the later stages of the battle, noting that throwing the Edomite captives from the top of a rock was an unjustified act of cruelty. As a direct punishment for this brutal behavior, the people of Judah faced severe consequences when the troops of Ephraim raided their lands and struck them down [מלבי״ם].