Maschil of David; A Prayer when he was in the cave. Of the word "maschil," See Gill on "Ps 32:1," title. This psalm is called a prayer, as some others are, the ninetieth and hundred second psalms: and was composed by David when either in the cave of Adullam, 1 Samuel 22:1; or rather in the cave at Engedi, where he cut off Saul's skirt, 1 Samuel 24:3; as Jarchi and Kimchi think. The psalm represents the troubles of David, and of the Messiah his antitype, and is applicable to the church of God, or to any particular soul when in distress.