David wrote many of his Psalms as a prayer in a desperate time. So many of them start with him being surrounded by enemies, but end with God rescuing him.
Psalm 7 is no different:
Psalm 7:1-2 I come to you for protection, O Lord my God.
Save me from my persecutors—rescue me!
If you don’t, they will maul me like a lion,
tearing me to pieces with no one to rescue me.
But in the middle, David talks about the value of repentance:
Psalm 7:12-13 If a person does not repent,
God will sharpen his sword;
he will bend and string his bow.
He will prepare his deadly weapons
and shoot his flaming arrows.
And the long-term path for the wicked, who don’t repent:
Psalm 7:14-16 The wicked conceive evil;
they are pregnant with trouble
and give birth to lies.
They dig a deep pit to trap others,
then fall into it themselves.
The trouble they make for others backfires on them.
The violence they plan falls on their own heads.
As with most Psalms, it finishes with God:
Psalm 7:17 I will thank the Lord because he is just;
I will sing praise to the name of the Lord Most High.