The title of Psalm 52 tells us that it was written by David, when Doeg, the Edomite, came and told Saul, ‘David has come to the house of Ahimelech.’ This is a reference to 1 Samuel 22:6-23, where Saul slaughtered the Israelite priests at Nob by the hand of Doeg the Edomite. This ugly and tragic event prompted David to pen the Psalm.
In Psalm 52 David indicates the kind of man Doeg is. In a word, he is bad. Doeg’s most destructive weapon was his deceitful tongue. He loves evil more than good, lying and all words that devour (v. 3-4). Doeg’s bitter words resulted in his gaining a short-lived opportunity in the eyes of king Saul. But God will have the final word on bad men like Doeg. David declares, God will break you down forever; he will snatch and tear you from your tent; he will uproot you from the land of the living (v. 5-7). Such is the end of Doeg and all who follow in his evil footsteps.
In contrast to Doeg (the bad) who is uprooted from the land of the living (v. 5) is David (the good) is like a green olive tree in the house of God (v. 8). While Doeg trusted in the abundance of his riches (v. 7), David trusted in the steadfast love of God (v. 8). Doeg’s brief rise to fame followed by sudden destruction is contrasted to David’s perseverance and preservation, just like the olive tree, among longest living of the trees in Israel.