How will Hashem gather them?
Radak, Malbim: He will put in their hearts to come to Yerushalayim for war, like it says "v'Ha'alisicha mi'Yarkesei Tzafon va'Havi'osicha Al Harei Yisrael" (Yechezkel 39:2). Malbim ? we explained in Yechezkel (Perakim 32, 38) that Bnei Edom will gather to take Yerushalayim from the Yishmaelim. Then the city will be captured and the houses will be trampled.
Why will Hashem allow the city to be captured and the houses trampled?
Rashi: It is lest the Goyim have a defense, to say 'we did not come for war, rather, only to bow.'
Radak: This is to refine the third that will remain. Yeshayah said about them "Chavi Chim'at Rega Ad Ya'avor Za'am" (26:20), and Daniel said "v'Haysah Ez Tzarah Asher Lo Nihyasah mi'Hyos Goy?" (12:1). "V'Nashasu" is from the root Shasas, as is "Mi Nasan li'Mshisah Yakov" (Yeshayah 42:24); it is plundering.
What do we learn from "v'Yatza Chatzi ha'Ir ba'Golah"?
Radak: They will exile them from the city like captives to [the besiegers'] tents outside the city. Until then, Hashem will leave them in the hands of their enemies to refine them. They will be saved from everything written, and accept the affliction with a good heart.
Malbim: Half the nation already went to Galus.
What do we learn from "v'Yeser ha'Am Lo Yikares"?
Rashi: Not all will be exiled.
Radak: Hashem will not leave them further in the hands of their enemies. With His help, Yisrael will overpower their enemies ? "v'Yatza Hashem?" (3).