The meaning of the transliterated Hebrew expression “maskil” is uncertain. In the Septuagint, the corresponding term is a form of synesis, meaning “understanding” or “intelligence.”
The superscription ascribes the composition to David and identifies the setting as his being in the cave. It likely was the cave of Adullam. By feigning insanity, David, during the time he was in flight from King Saul, escaped possible death in the Philistine city of Gath. After leaving Gath, he and his men took refuge in the cave of Adullam. (1 Samuel 21:10-22:1)
The psalm is a prayer. As such, it reflects the depth of David’s distress as an outlaw among his own people.
Faced with grave danger, David cried out to YHWH for help. Coupled with “cry,” the mention of the “voice” indicates an intense, audible prayer or supplication for favor or mercy. David, in prayer, did not hold back from expressing himself about his distressing circumstances. Like water, he “poured out” his lament and voiced his anxiety.
When speaking of his spirit fainting, he is evidently referring to being reduced to a weak and helpless state. He recognized, however, that YHWH was fully aware of his desperate situation—his way. In the path he walked, his antagonists had hidden a trap for him. This may allude to Saul’s supporters who were on the watch for David’s whereabouts and acted as informants. (Compare l Samuel 23:19-23; 26:1.)
At his right hand, where a friend should be to lend assistance, David looked in vain for someone to take notice of his plight. Perceiving himself to be trapped, he saw no place for taking refuge. No one inquired about his “soul,” that is, no one really cared about him.
Although greatly discouraged, feeling that no one was concerned about his welfare and willing to come to his rescue, David did not lose faith in his God. He continued to cry out to YHWH as the one who was his dependable refuge or, as the Septuagint says, his hope. In the land of the living, YHWH was his portion, indicating that all that he possessed was this precious relationship with him. Beside his God, he had no refuge and no dependable source of comfort and aid.
In former times David’s situation had been much better. As one brought low, reduced to a state of weakness and helplessness, he pleaded for YHWH to heed his cry for deliverance from those who were pursuing him. They were stronger than he was.
David felt as though he was in a prison, a state of confinement, cut off from every avenue of escape. He petitioned YHWH to take him out of this prison, enabling him to give thanks to his name (YHWH, the One represented by the name) for having been rescued.
Like many of the other psalms that start on a note of pitiable helplessness and despair, this one also ends with an expression of confident hope. The time would come when the righteous would surround David because YHWH had dealt rewardingly with him. Evidently this meant that they would rejoice with him over the marvelous deliverance that the Most High had effected on his behalf.
Note: Regarding the divine name (YHWH), see Psalm 1.