The Mekhilta DeRabbi Yishmael presents a teaching that parallels and extends the previous one about divine wrath, now turning to the subject of divine warfare. The principle is the same, but the stakes are even higher.
When Israel does God's will, He fights on their behalf. The proof text is (Exodus 14:14): "The L-rd will war for you." This verse, spoken by Moses to the Israelites at the edge of the Red Sea with the Egyptian army bearing down on them, is one of the most dramatic promises in the Torah. Israel does not need to fight. God Himself takes up arms. The Creator of the universe becomes a warrior, and no earthly army can stand against Him.
But when Israel does not do God's will, the Mekhilta warns, the same God who fought for them becomes their adversary. The proof text is devastating: (Isaiah 63:10): "And He turned into a foe of theirs; He warred against them." The God who drowned Pharaoh's army, who scattered Amalek, who toppled the walls of Jericho, now turns that same irresistible power against His own people.
The symmetry is terrifying. The same divine military power that makes Israel invincible when they are righteous makes their situation hopeless when they rebel. There is no neutral position. God is either fighting for Israel or fighting against them, and the deciding factor is always the same: whether they do His will.
This teaching shaped Jewish theology of defeat and exile. When the Temple was destroyed and Israel was scattered, the rabbis did not conclude that God was weak. They concluded that He had switched sides, turning from protector to adversary because Israel had abandoned His commandments. The path back was equally clear: return to God's will, and the divine warrior returns to your side.