English Basic Explanation - Chapter 57
In the first verse of this chapter we are told that David composed this prayer "as he fled from Shaul in the cave." A number of commentaries explain this as a reference to the famous incident recorded in the Book of Shemuel I (chapter 24) where David and his men hid from Shaul inside a cave in Ein Gedi, and Shaul entered the cave to relieve himself. David, of course, faced immediate danger and immediately, it seems, composed and recited this prayer to God. The opening verse of this Psalm introduces the prayer with the term "Al Tash'het," literally, "do not destroy," which encapsulates the basic theme of this Psalm, in which David pleads to God not to allow Shaul to discover him.
Appropriately, David describes his situation as though he sleeps among vicious lions with sharp fangs (verse 5). The sight of his ruthless pursuer just several feet in front of him in the cave conjured in his mind the image of a man standing in a den of ravenous lions, from which he can escape through only supernatural divine intervention.
In the second half of this chapter (verses 7-12), the tone of fear and desperation suddenly transforms into one of triumph and thanksgiving. David speaks of his adversaries falling into the very trap they had set for him, and announces his plans to sing praises to the Almighty each day in the early morning hours. Some commentators (such as the Radak) explain that David recited these verses in anticipation of God's salvation. Alternatively, it could be suggested that this section was composed after Shaul exited the cave without taking note of David. The narrative in Shemuel I tells that Shaul did not notice David, and David's men urged him to kill Shaul inside the cave. David refused to kill the king whom he described as "the anointed one of God" ("Meshi'ah Hashem" – Shemuel I 24:10), and instead quietly severed the corner of Shaul's garment so that he could later demonstrate to Shaul his loyalty. One might suggest that after this incident David composed the final verses of this Psalm, celebrating his salvation and promising to sing praises to God, "because Your kindness extends to the heavens, and Your truth extends to the firmaments" (verse 11).