Albert Barnes' Bible Commentary
Psalms 142 - Introduction
This also is a psalm of David. It is entitled, like not a few others of the Psalms, “Maschil;” margin, “giving instruction:” a didactic hymn. See the word explained in the Introduction to Psalms 32:1. It is said, in the title, to be “A prayer when he was in the cave;” that is, either a prayer which he composed while there, or which he composed afterward, putting into a poetic form the substance of the prayer which he breathed forth there, or expressive of the feelings which he had when there. The reference may be either to the cave of Adullam 1 Samuel 22:1, or to that in Engedi 1 Samuel 24:3. In both cases the circumstances were substantially the same, for David had fled to the cave to escape from Saul. The prayer is such as would be appropriate to a condition of danger such as was that in which David then was. It is a cry of distress when there was no refuge - no hope - but in God; when there seemed to be no way of escape from his enemies; and when, forsaken by his friends, and pursued by an enemy who sought his life, he seemed now to be in the power of his foe. It may also be “used” to express the feelings of one now in danger - as of a sinner under condemnation, seeing no way of escape, exposed to ruin, and shut up entirely to the mercy of God. Such a one feels, as David did on this occasion, that there can be no escape but through the interposition of God.