From the title, we are told that this song was written by David, while he was being chased through the wilds of Judah. Commentators are split on who, exactly, is chasing him. It is either Saul, prior to David ascending to the throne, or his son Absalom, who sent David into exile. Nothing in the title or the text of the psalm identifies his pursuers so theologians are left to speculate.
I believe this song to be written while David was in flight from Absalom. Verse 11 says, “The King will rejoice in God.” This would be an unlikely thing for David to say about Saul; however, he would have never referred to himself as King while Saul was still occupying the throne. Although wicked, in David’s heart Saul remained God’s anointed king.
This psalm contrasts the yearning of the flesh (v.1), and the contentment of the soul (v.5). He speaks of being in a dry and weary land (v.1), and yet he’s feasting on spiritual marrow and fatness (v.5). David is sustained by his intimate relationship with almighty God, and he regards this relationship as superior to anything offered in life (v.3). In the midst of this highly stressful circumstance, David’s focus is on the Lord, not himself.
What I find most significant about this psalm is that of its 11 verses, the first 8 contain nothing but praise. He recalls seeing God—His power, His glory, and His lovingkindness—in the sanctuary, and responds by lifting his hands in exaltation. He remembers God while on his bed, he meditates on the Lord—His help and protection in times of need. His soul is comforted by all he knows to be true of God.
When I recall moments of great distress in my own life—never approaching the circumstance David find himself in—my inclination in prayer was to plea for relief. To cry for help in times of despair is certainly what we should do (James 5:13), but by first considering what we know to be true of God and praising Him for who He is, our focus is no longer on our circumstances; but is instead on our Heavenly Father, who is kind and merciful. We can then, in confidence, trust that God will care for us just as He has promised.