As Jerusalem and the king of Judah faced invaders, God gave Jeremiah insight into His long-term plan. The promises would only come true after the destruction. The nation's hope was not in avoiding destruction but in the purification it would bring.
Jeremiah was confined in the courtyard of the guard in the royal palace from late 587 BC, during the siege, until Jerusalem fell in August 586 BC (see Jeremiah 32:2).