When G-d will "punish the earth's dwellers for their sins, He will strike down the three major Jewish oppressors: Egypt, Assyria and Edom-Rome, referred to here as the "Straight Serpent," the "Twisted Serpent" and the "Dragon." But on a different level, each is referred to by all appellations, because each in their respective times was a world superpower and ruled the earth as sea serpents rule the sea. Their kingdoms stretched across vast lands as something stretches across more space when "straight" than when "twisted." But in their behavior, they were devious and "twisted," and G-d will slaughter them all with His sword.
In truth, says G-d, He bears no anger against His people even when they stray - when their "vineyard gives forth only thorns and thistles" - for if He did, He could easily destroy them, unless they returned to Him and His "refuge," His teachings.
"In the Future, Jacob shall take root, Israel shall bud and flower and the earth shall be filled with produce." - Isaiah 27:6
Unlike during the exile, when the Jewish people were homeless, when Redemption comes, they will "take root in their Land, bud and flower." Like such flowers, they will be spiritually whole and devoid of sin, and as a people, they will fill the earth.
Even when G-d smote the Jewish people, He did not smite them as He did other nations. Some of those nations were erased from the face of the earth and others were subdued for all times after G-d smote them only once. Only the Jewish people have been repeatedly smitten yet still exist as a nation. When G-d punished them, He did it with measure, not with the full force of His power. He smote first their property before their souls. He did not destroy them as a people, but sent them into exile "with a strong gust," literally, a heavy spirit - He also suffered with them, so to speak, in their exile.
G-d's exiling of the Jewish people is not just to punish them - the ultimate goal is to uproot idolatry from their hearts so that they destroy it from their Land. And when Jerusalem, their "fortressed city" will be desolated and G-d's dwelling place," the Temple, shall be abandoned, they will realize the futility of their false beliefs.
When the Jewish "leaves" are all dried up - when all their resources are exhausted - they shall collapse and fall from their own weight. Then, when the Jewish people are already broken, even a nation as weak as women will be able to overcome them. This will befall them because they had not the understanding to attribute their hardships to their abandoning G-d.
But after the exile, after the Jewish people have been purified, G-d will gather them from the far corners of the earth - from the Euphrates River til the Nile. As one beats chaff to extract the wheat that is in it, G-d will beat the nations to take out His people. Even if only few remain by the end of the long purification process, G-d will gather them "one by one." Even those who were forced to renounce their faith - the "lost ones" - whether by direct or indirecet gentile pressure, and those whose faith was weakned but not renounced - the "banished ones" - shall all be brought back to the fold. The sound of the great shofar shall rouse their hearts to come back and surrender to G-d.