A Psalm of Thanksgiving: 22:1 David was a noted poet and musician, and it was important to include an example of his artistic skills in any record of his life. There are, as Gordon points out (1 and 2 Samuel: A Commentary, p. 309), marked similarities in theme between this psalm and Hannah’s song (1 Sam. 2). One reason for including this psalm may be to provide a parallel to that song and to draw the reader’s attention to the strength and the care of God at both ends of this part of the history.
There is no reason to doubt that David composed as well as sang this psalm, which with minor variations is recorded as Psalm 18. It may be that this was an earlier version, a first draft that was then formalized for use in corporate worship. The pattern or form of the psalm as we have it here is of …