7 Since they hid their net for me without cause
and without cause dug a pit for me,
8 may ruin overtake them by surprise—
may the net they hid entangle them,
may they fall into the pit, to their ruin. Psalm 35:7-8
Sometimes it’s necessary to pray for and against your enemies. The Bible teaches us in the New Testament to pray for those who persecute us (Matthew 5:44). As we see in these verses (and plenty of others in the Book of Psalms), David is thinking out loud in his prayers and wishing that the traps that have been set will backfire on his enemies. So how do these two concepts jibe with each other?
I think this is summed up in Psalm 55:9, “Confuse the wicked, O Lord, confound their speech, for I see violence and strife in the city.” Obviously there are all kinds of prayers you can pray for (and against) someone. You are praying for the person but it’s a “productive” prayer.
Think of the tiny nation of Israel. Somebody has been praying Psalm 55:9 over that nation for the past 60 years since they became a nation in 1948. Israel is surrounded by those who hate them (and would love to annihilate them), but no one seems to be able to destroy them. God has clearly confused the minds of those who would destroy her, and often when they do try, their methods backfire.
So in this instance, people are praying for the Muslims who surround Israel, and they are praying David’s prayer in this Psalm.