Never be content with a mere translation of words. If this were a modern work of Western song, we would say it was a long string of clichés. However, in good Hebrew verse, this is how it’s done. Readers of David’s time would have been enthralled at the drama invoked by the common figures of speech. Much of Hebrew writing is figurative and parabolic, so you can’t understand Hebrew until you get used to that.
It seems obvious David is not describing the context. Rather, he is reacting to something traumatic; that’s all we need to know. He was born for trouble and it seemed his natural element. His soul thrived and his character was so large and powerful because he handled it and kept moving forward. That does not mean he didn’t stress out at times. The biggest war in sight here is internal, the fleshly mind of David fighting with the heart and soul committed to God.
The first half of the psalm is a litany against fear, a loud proclamation that God is his Protector and wholly trustworthy. Then David pours out the pain of his sorrow in a few more verses. In sum, he felt doomed. As was so often the case, whatever this experience entailed, it included efforts by others to destroy David in his role as king. Then he again asserts that God can plainly see all of that, and with far more detail and clarity than David could discern. But God also has the power and promise to protect those who cling to His covenant. It is those who reject God’s moral character in life that will suffer the evil they plotted for others.
We get the sense he hardly gets a good lament going when God answers. Go ahead — don the sackcloth and ashes, but be ready to turn around and celebrate before you have a chance to change out of them.