The heading provides for us the setting for Psalm 57. David is in desperate straits. Be believes, as he’s said to Jonathan, that he is only one step from death.
Pursued by Saul, David finds refuge in caves where he is joined by a band of not-so-merry men – distressed, indebted, discontented.
How could David associate himself with such low-lifes?
He didn’t. They associated themselves with him, and he took them in. But he never lost sight of who they were as this Psalm plainly reveals. Other than this band of men, David has no supporters. Even those he rescues are willing to betray him (cf. 1 Samuel 23 and the city of Keilah). With Saul hot on his trail, David takes refuge in a cave. Saul arrives and no doubt he and his men observed Saul’s movements. Then, as if Saul sees them, Saul excuses himself his soldiers and heads toward David’s cave! The men fall back to its furthest recesses. Saul enters, perhaps disrobes, and begins to relieve himself. Seeing Saul’s vulnerability, David is pushed by his soldiers to attack. But David refuses.
Later, David composes this Psalm which, surprisingly, spends more time describing David’s companions than his pursuers. Surrounded by “ravenous beasts” (his own men) and chased by the army of Israel, David really has no place of refuge but God. “Between a rock and a hard place,” David takes time to acknowledge his predicament and reaffirm his trust in the Lord.