We see the people of Judah choose to leave Jerusalem as it is begin burned down to the ground and go south to Egypt as opposed to being carted off by the Babylonians into exile. Jeremiah had warned them that this was not the plan. Do not choose to go into Egypt, but rather, allow the Babylonians to capture you. If you go into Egypt you will be slaughtered and killed for the Babylonians will conquer Egypt. If you allow yourself to be taken into exile, who knows, some day you may return, and if not you, then at least your progeny would return. They did not listen. They went to Egypt and took Jeremiah with them.
God then gives warning to the Philistines and those in Moab that God would bring down his wrath on them as well. They were, after all, people who did not follow the Lord and were content and smug in their status thinking that they were safe. They were not safe and God was about to show them how unsafe they were. Keep in mind Babylon is not an ally of the Lord, they do not worship the God of Israel. But even in that state God is still able to use them to carry out His purposes.
Psalm 56 is interesting especially if you pay attention to the prescript. There is a specific tune to which it ought to be sung and it describes a time in the life of David when he was seized by the Philistines in Gath. He asks for God to protect him. We know that God does absolutely protect him.