The events surrounding Jeremiah's imprisonment are consistent with Nephi's description of conditions in Jerusalem. Jeremiah had been rejected by his own people.
"The people's response to Jeremiah was anything but positive. The men of Anathoth, Jeremiah's home town, sought his life (see Jer. 11:21Jer. 11:21), leading him to cry unto the Lord to know why the wicked prospered. (See Jer. 12:1Jer. 12:1.) He further lamented over his being born 'a man of strife and a man of contention to the whole earth.' (Jer. 15:10Jer. 15:10.) His enemies devised ways to oppose his counsel and sought to take his life. (Jer. 18:18Jer. 18:18, Jer. 18:23 23.)
"Jeremiah was taken before the princes of Judah and accused of being 'worthy to die' for having prophesied against Judah. But as he faced his accusers in the temple courtyard, Jeremiah fearlessly repeated his prophecy. His life was spared, however, because of the intervention of a high-ranking officer. (See Jer. 26:1Jer. 26.) Jeremiah was placed in stocks overnight for prophesying against Jerusalem and all Judah's cities. (See Jer. 19:0Jer. 19:1Jer. 19:2Jer. 19:3Jer. 19:4Jer. 19:5Jer. 19:6Jer. 19:7Jer. 19:8Jer. 19:9Jer. 19:10Jer. 19:11Jer. 19:12Jer. 19:13Jer. 19:14Jer. 19:15Jer. 19:16Jer. 19:17Jer. 19:18Jer. 19:19Jer. 19:20Jer. 19-20.) This was a punishment to bring public scorn and ridicule upon an offender." (Monte S. Nyman, "Jeremiah's Prophetic Warning Rejected by People of Jerusalem," LDS Church News, 1994, 12/31/94)
The political situation of the time was precarious. The kingdom of Judah was sandwiched in between two great powers, the Egyptians and the Chaldeans (or Babylonians). The Jews had hopes that the Egyptian army would protect them from the Babylonians. In one instance in which the Babylonians had besieged Jerusalem, the army of Pharoah came up to Jerusalem and scared them off. After this, Jeremiah made it clear that Zedekiah was in trouble. He prophesied, 'Behold, Pharaoh's army, which is come forth to help you, shall return to Egypt into their own land. And the Chaldeans shall come again, and fight against this city, and take it, and burn it with fire' (Jer 37:7-8). Soon thereafter, Jeremiah was taken, accused of desertion, and imprisoned (Jer 37:12-15). Jeremiah would be in prison, off and on, for most of the next 11 years.