Ezra 9:7shevi
From the days of our ancestors until now, our guilt has been great. Because of our sins, we, our kings, and our priests have been punished by the sword and captivity. Foreign kings have taken away our things and shamed us, even as it is today.
Captivity explained as punishment for the people's sins.
Jeremiah 29:14shevut
I will let you find me," says the Lord. "And I will bring you back from your captivity. I forced you to leave this place, but I will gather you from all the nations, from the places I have sent you as captives," says the Lord. "And I will bring you back to this place."
God promises to gather his people back from captivity.