Psalm 7 shows King David of Israel in desperate trouble again. In verse 1 he's trusting God to save him from a deadly situation. It seems as if the speaker has many enemies, but verse 2 mentions one person in particular who is ready to tear the speaker in pieces. This enemy is compared to a lion.
Side note on lion-metaphors in scripture: I find it interesting that David's evil enemy is compared to a lion, and in the New Testament Satan himself is compared to a "roaring lion, seeking whom he may devour," which are both incredibly negative images involving lions. But Jesus is also called the Lion of the tribe of Judah, and most modern readers are aware that perhaps the most memorable allegory of Jesus in fiction involves a lion (Aslan) as the stand-in character for the son of God. It seems like lions in the Bible are symbols of absolute strength, and that strength can either be depicted positively or negatively. As opposed to, say, snakes and serpents which are always shown in a negative light.
Verses 3-5 show the speaker contemplating a situation where he might deserve his current misfortune. If he were an evil person who attacked innocents without a reason, then he would deserve death and dishonor, but the speaker reminds God that he is not evil, and in fact he is a very merciful person.
Verse 6 shows the speaker asking God to fight fire with fire and meet the enemies' anger with his own divine anger, which they can't possibly withstand.
No idea what verse 7 is about. If you know, feel free to tell me.
Verses 8-11 says that God judges everyone, but the speaker would like God to judge him based on his righteousness--the speaker is confident that the judgment will come out in his favor. The speaker calls for an end to wicked behavior because God weighs people's hearts and motivations. He knows why we do what we do.
Verses 12-16 involve some highly skilled metaphors about God destroying evil. God is a swordsman, an archer, and a general ordering destruction. But the destruction of the wicked doesn't just involve God taking action; part of their downfall is caused by their own actions. Evil people are described as digging a deep pit and then falling into it themselves.
Verse 17 brings an abrupt change in tone and shows the speaker rejoicing and praising God for his righteousness.
1O Lord my God, in thee do I put my trust: save me from all them that persecute me, and deliver me:
2 Lest he tear my soul like a lion, rending it in pieces, while there is none to deliver.
3 O Lord my God, If I have done this; if there be iniquity in my hands;
4 If I have rewarded evil unto him that was at peace with me; (yea, I have delivered him that without cause is mine enemy:)
5 Let the enemy persecute my soul, and take it; yea, let him tread down my life upon the earth, and lay mine honour in the dust. Selah.
6 Arise, O Lord, in thine anger, lift up thyself because of the rage of mine enemies: and awake for me to the judgment that thou hast commanded.
7 So shall the congregation of the people compass thee about: for their sakes therefore return thou on high.
8 The Lord shall judge the people: judge me, O Lord, according to my righteousness, and according to mine integrity that is in me.
9 Oh let the wickedness of the wicked come to an end; but establish the just: for the righteous God trieth the hearts and reins.
10 My defence is of God, which saveth the upright in heart.
11 God judgeth the righteous, and God is angry with the wicked every day.
12 If he turn not, he will whet his sword; he hath bent his bow, and made it ready.
13 He hath also prepared for him the instruments of death; he ordaineth his arrows against the persecutors.
14 Behold, he travaileth with iniquity, and hath conceived mischief, and brought forth falsehood.
15 He made a pit, and digged it, and is fallen into the ditch which he made.
16 His mischief shall return upon his own head, and his violent dealing shall come down upon his own pate.
17 I will praise the Lord according to his righteousness: and will sing praise to the name of the Lord most high.