I find it interesting that prophecies about Israel’s judgment always seem to be accompanied by prophecies of judgment on the very nations being used to punish Israel. (Now, I have not checked whether it is literally every prophecy of judgment. I mean that as I read this passage, that is the over-all impression I am operating within.)
I find it interesting because it delivers a very clear message: Just because they are going to defeat you does not mean they have received favor or approval!
They will be given a major victory. That does not mean God likes them. In fact, they will face their own judgment soon enough. In fact, their judgment is going to be rather more extreme and final.
Israel/Judah is not going to be entirely eliminated. Israel/Judah will be redeemed, eventually. Those other nations? They’re going to be wiped out entirely. They’re done.
In pagan belief systems, it is very common to assume that the conquering nation, the martial victor, has the stronger god. Or, if the peoples in question sacrifice to the same gods, clearly the victor has the favor.
God wants it to be very clear that this is not the case. They aren’t winning because they favored. They aren’t winning because their gods are stronger. They are winning because God wants to teach his children lesson in faithfulness. Because there are consequences for breaking the covenant. It isn’t about the conquering nations at all, they aren’t winning; Israel/Judah is losing.