This psalm is ascribed to David, evidently written in a time of danger
(12). It may have been prompted by the help provided by Ahimelech the
priest, and the opposition of Doeg the Edomite, who saw David at the
tabernacle and later reported him to Saul (cf. 1Sa 21:1-10; 22:9).
This was also a time when David sought protection for his parents (cf. 1
Sam 22:3) which may have left David feeling abandoned (10).