"Surely He will not stretch out a hand against the ruin-heap, though in His disaster they cry for help" (Job 30:24). Rabbi Abbahu said: The Holy One, blessed be He, does not strike a nation and leave it lying on its side; rather He brings calamity upon this one and diverts it with that one, He brings calamity upon this one and diverts it with that one. He brought calamity upon Assyria and diverted it with Egypt: "Are you better than No-Amon?" (Nahum 3:8). He brought calamity upon Egypt and diverted it with Assyria: "Behold, Assyria was a cedar in Lebanon" (Ezekiel 31:3). Rabbi Yassa said: Why did the ten tribes go into exile first and only afterward the tribe of Judah and Benjamin? So that these might be comforted by those. Therefore, "Comfort, comfort" (Isaiah 40:1).
How God Distracts One Nation While Striking Another
Pesikta DeRav Kahana 16:7
[ז] אך לא בעי ישלח יד אם בפידו להן שוע (איוב ל:כד). א"ר אבהו אין הקב"ה מכה אומה ומושיבה צדו, אלא מביא פיד לזו ומשעשעה בזו, מביא פיד לזו ומשעשעה בזו. הביא פיד לאשור ושיעשעה במצרים, התיטבי מנא אמון (נחום ג:ח). הביא פיד למצרים ושעשעה באשור, הנה אשור ארז בלבנון (יחזקאל לא:ג). א"ר יסא מפני מה גלו עשרת השבטים ואחר כך גלה שבט יהודה ובנימן, כדי שיהו מתנחמים אילו מאילו. לפיכך נחמו נחמו (ישעיה מ:א).