Solomon speaks about events that he thinks could happen in the future. The situations he describes in verses 36-38 are conditions for what he requests verse 39.
Here "carries them away" represents forcing them to leave their own country. Alternate translation: "so that the enemy forces them to leave" (See: [[rc://en/ta/man/translate/figs-metaphor]])