The title, also known as an ascription, states that David wrote this psalm when he had fled from King Saul into the cave (1 Samuel 24). King Saul had convinced himself and others that David wanted to “…cut off his descendants or wipe out his name from his father’s family” (1 Samuel 24:21), so he pursued David to kill him.
David and his small band of men fled from Saul when he heard Saul was headed his way with three thousand soldiers. David hid deep in a cave in an area that is still known to have many caves and a major oasis (the west side of the Dead Sea). King Saul happened to go into the cave to relieve himself. David could have killed him. Indeed, his men tried to convince him to do that very thing. David did not want to even hurt God’s anointed king let alone kill him. (1 Samuel 24:6) David spared King Saul’s life.
Instead of heading to his men who said, “This is the day the LORD spoke of when he said to you, ‘I will give your enemy into your hands for you to deal with as you wish.'” (1 Samuel 24:4) David wrote this prayer psalm.
Using the allegory of night (4, “I lie down”) and day (8, “I will awaken the dawn”) David cried out to the Lord God Most High to have mercy on him. Fitting for being deep in a dark cave. David speaks of how the God Most High, “sends from heaven and saves him and rebukes King Saul (3).
When my life is threatened I must do four things. First, do not do what is wrong. Second, pray to God. Third, have faith while I wait for his deliverance. Fourth, praise him for delivering me.