When it became evident to all but Jonathan that Saul was out to kill David, David ran.
And ran. And ran.
He ran first to his wife, who put herself in harms way to save David. He then ran to Samuel, who hid him for a while but eventually was also no safe harbor. David ran to Jonathan and after a bit of investigation, Jonathan too was convinced he could not save David. David then ran to the priests of the Lord at Nob (1 Samuel 22), who gave him food and weapons.
But there, among the priests, was a horrid fellow named Doeg. What he was doing there is anybody’s guess, but David knew he was out of place. When David left, Doeg reported to Saul about David’s presence and the priests of Nob were brought before the king. On orders from Saul, Doeg put them and their families and livestock all to death – and David felt the guilt that his actions had resulted in the deaths of the entire population of Nob.
Psalm 52 may have Doeg in mind.
Or it may speak of Saul.
In any case, neither man can seem to see the hand of God in their lives. David, however, does. Though bad things are happening all around him, he is cognizant that God is in control and is taking care of him. He does not berate God for sparing him and taking the inhabitants of Nob. As much as he may have been willing to give his life for theirs’, he looks beyond that event to what God is doing for the future of Israel – specifically with David.
The Psalm is a reminder to us all that though God may have seemed to fail in the lives of others, as long as we have breath, He is succeeding in ours.