I found verses 15-16 interesting as I read Psalm 9 today. I don't know if this was David's prayer or an observation he made, but notice what he said about the heathen (Good News Translation)
15 The heathen have dug a pit and fallen in; they have been caught in their own trap. The Lord has revealed himself by his righteous judgments, and the wicked are trapped by their own deeds.
The heathen have dug a pit and fallen in
caught in their own trap
wicked are trapped by their own deeds
Maybe that's how God often brings judgement or perhaps it's just part of the biblical principle that you reap what you sow.