Opposition from the ungodly.
v1-2: David does not describe attacks on himself, but the injustice of leaders, who were attacking the people of the land.
v3-5: His observation is that such people of persistent ungodliness, even from the womb. Human means (as in the snake charmer) cannot change the heart and attitudes of such people.
v6-9: If those people will not repent an change, they will receive God's judgment. David's prayer may seem harsh, but it reflects God's own heart; for the righteous God will truly judge the wicked. David's righteous anger towards the ungodly is because they have lived unrighteously. It is not just that they have attacked him.
v10-11: The response of the righteous, rejoicing that God's righteousness is manifest. See Gen 18.25; this world is manifestly unfair; the wicked are cruel and selfish, and judge unrighteously - how different is our God, who is perfect in righteousness.