This psalm of David is his prayer “concerning Cush of the tribe of Benjamin”. Who this man was is unknown; he is mentioned nowhere else in the Bible. Because he is mentioned as from the tribe of Benjamin, he may have been a friend or relative of King Saul, and the time frame may be between the killing of Goliath and David’s uniting all the tribes under his rule.
It appears from the context that Cush may have set a trap for David, was discovered, and lost his life in the process (verses 12-16). David started this prayer/song by asking God to protect him from his enemies and told the results if God didn’t. Then, David told the Lord, “if I have done wrong” and lists examples and said let my enemies have me. Maybe these were things Cush had accused him of doing that would have shown David had no integrity (verses 1-5).
David recognized that he could not see the intent someone had, but “You look deep within the mind and heart, O Righteous God” (verse 9). In verses 10-11, he trusted God as his shield and declared “God is an honest judge”. Then in verse 17, David closed his prayer/song with a great statement of faith: “I will thank the Lord because He is just; I will sing praise to the name of the Lord Most High”.