Jeremiah 51 is a continuation of the previous chapter's oracle against Babylon. In this chapter the prophet refers to Babylon as "Leb-Kamai" (v. 1) and "Sheshak" (v. 41). YHWH tells the Judahites to get out of Babylon because he's sending armies to destroy the nation.
Sharpen the arrows,
take up the shields!
The Lord has stirred up the kings of the Medes,
because his purpose is to destroy Babylon.
The Lord will take vengeance,
vengeance for his temple.
(Jeremiah 51:11 NIV)
In verses 20-23 YHWH says that he is sending a war club to smash (NRSV) or shatter (NIV) Babylon. The Hebrew phrase "with you I smash/shatter" occurs 8 times in these 4 verses. The precise identity of the war club is unclear. I would have to guess it's the Medes from verse 11 quoted above.
Verse 58 serves as a good summary for the chapter:
This is what the Lord Almighty says:
"Babylon's thick wall will be leveled
and her high gates set on fire;
the peoples exhaust themselves for nothing,
the nations' labor is only fuel for the flames."
(Jeremiah 51:58 NIV)
The chapter ends with a prose passage in which, at Jeremiah's direction, Baruch's brother Sereiah performs a prophetic act. He reads Jeremiah's prophecy to the exiles in Babylon, ties a stone to the scroll, and tosses it into the river Euphrates.
So will Babylon sink to rise no more because of the disaster I will bring on her. And her people will fall.
(Jeremiah 51:64 NIV)
That's it for Jeremiah's prophecies. Chapter 52 is a kind of historical appendix which closely parallels 2 Kings 24:18-25:30. It describes the fall of Jerusalem. The New Interpreters Study Bible has a note that offers a plausible explanation for this chapter:
At first glance, the chap. appears superfluous, but it actually presents the fulfillment of Jeremiah's message of judgment. It portrays the destruction of the nation's symbols in the invasion of the holy city, the blinding of the king, the death of the heirs to the throne, and the destruction of the temple. Whatever historical data may underlie the account, the chapter shows the nation's collapse just as Jeremiah had promised. Perhaps Jeremiah's words of hope will prove equally reliable.
Next: Lamentations 1-2