22:1 And David spake unto the LORD the words of this {a} song in the day [that] the LORD had delivered him out of the hand of all his enemies, and out of the hand of Saul:
(a) In token of the wonderful benefits that he received from God.
22:1-51 David's psalm of thanksgiving. - This chapter is a psalm of praise; we find it afterwards nearly as Ps 18. They that trust God in the way of duty, shall find him a present help in their greatest dangers: David did so. Remarkable preservations should be particularly mentioned in our praises. We shall never be delivered from all enemies till we get to heaven. God will preserve all his people, 2Ti 4:18. Those who receive signal mercies from God, ought to give him the glory. In the day that God delivered David, he sang this song. While the mercy is fresh, and we are most affected with it, let the thank-offering be brought, to be kindled with the fire of that affection. All his joys and hopes close, as all our hopes should do, in the great Redeemer.