Jeremiah 49:4

Wherefore gloriest thou in the valleys, thy flowing valley, O backsliding daughter? that trusted in her treasures, saying, Who shall come unto me?

The verse belongs to the closing chapters of Jeremiah, chapters 46 to 51, which pronounce doom upon the foreign kingdoms surrounding Israel. That portion holds prophecies against Egypt, Philistia, Moab, Ammon, Damascus, and above all Babylon. It belongs especially to the section containing prophecies against foreign nations with Babylon foremost.
Babylon in that section is the kingdom that perverted all the other kingdoms of the earth, regarded not only as the ancient empire but as a type of mystical Babylon. Taken together with the next verse, the verse teaches that trusting in treasures and earthly resources is misplaced confidence that does not protect. Such trust brings fear upon those who rely on them, and they will be taken.