Jeremiah 11:12
Then shall the cities of Judah and inhabitants of Jerusalem go, and cry unto the gods unto whom they offer incense: but they shall not save them at all in the time of their trouble. Then shall the cities of Judah and inhabitants of Jerusalem go, and cry unto the gods unto whom they offer incense: but they shall not save them at all in the time of their trouble.
The verse belongs to God's announcement that Israel broke the covenant He made with them when He brought them out of Egypt and forfeited its blessings, with their covenant-breaking as the reason God finds fault with them and announces judgment. The chapter explains the breaking off of the branches of their olive tree from God's people as the result of that violation of the covenant. That announcement proves the first covenant was at fault through the failure of the people and opens the way for a second and better covenant established upon better promises, coming a few years before the promise of the new covenant.
The trouble announced was severe captivity in Babylon for seventy years after repeated rejection of God's mercy and warnings, as part of the announcement that further prayer would not avert the judgment. The exile taught them in hardship what they had failed to learn under more favorable conditions. In that time of distress the cities of Judah and inhabitants of Jerusalem will go and cry to the gods to whom they offer incense, but those gods will not save them at all. They are the many Baal gods whose altars were set up according to the number of the cities and of the streets of Jerusalem, and they are completely unable to deliver when distress comes.
Persistent disobedience brings a just harvest of evil that cannot be escaped, and further prayer will not avert it when calamity comes as the sure reaping of what was sown. The idea that a person can keep sowing disobedience and disease and wrongdoing industriously and then have every painful result miraculously uprooted in answer to prayer is a delusion, for what God does is directed not only by the greatness of His power to heal instantly but by the perfection of His wisdom, and He will not work miracles to sustain continued transgression. The verse utters an awful denunciation against sin joined with sorrow of heart over the people's transgression, making a most touching appeal to return to God that the mass of the people meet with utter lack of response.