Psalm 7 finds David in a tsunami of false accusations and slander. Though the specifics elude us, the words, “if there is wrong in my hands (v. 3), suggest allegations of bribery (2 Sam. 15:1–16).
It’s this smear campaign that sheds light on David’s seemingly self-righteous plea: “judge me, O Lord, according to my righteousness and according to the integrity that is in me” (v. 8). But David entertains no notion that he’s sinless; just read Psalms 32 and 51. Rather, his petition is specifically linked to the accusations leveled against him.
Further proof of David’s sincerity are the three if-clauses in verses 3–4 that culminate in his willingness to die if he’s guilty of sinning in the way his enemies charge. Instead of taking matters into his own hands, David foreshadows the behavior of his greater Son, Jesus Christ—the One who entrusted “himself to him who judges justly” (1 Pet. 2:23).
But what enables David to respond this way? Two things:
First, God’s character. Engraved on David’s soul is the truth that God is not lukewarm about justice. Indeed, God “feels indignation every day” (v. 11)—that is, his zeal for justice never fluctuates or changes; it doesn’t rise and fall depending on the day. In theological terms, God’s indignation is an impassible indignation.
Second, David has entrusted himself to this God—the just God. Tim Keller perceptively observes that David does not say, “I will take refuge in the LORD,” but “I take refuge,” indicating that he has placed his life in God’s hands. This trust in God frees David to rest in his wisdom and timing. Divine retribution will come; God will judge from his exalted throne (v. 11).
Here’s why Psalm 7 is good news: The one who will judge from his throne on high is also the one who was lifted high on the cross, promising that all who trust in him will escape judgment (John 3:14–18). For Christians, our judgment day has already come and gone.
Prayer: O Good God, the only searcher of men’s hearts, who preservest us that put our confidence in thee from danger of our enemies, lift up thy mighty arm, and put back all those that persecute us; and gather thy church dispersed by the tyranny of godless tyrants; and keep us continually under thy mighty defence, through Jesus Christ our Lord. Amen. (Prayer based on Psalm 7 from Prayers on the Psalms from the Scottish Psalter of 1595, 44).
 Timothy Keller with Kathy Keller, The Songs of Jesus: A Year of Daily Devotions in the Psalms (New York: Viking, 2015), 9.