Differences Between 2 Sam 22 and Ps 18

2 Sam 22 and Ps 18 are the same song, spoken in the day that the Lord had delivered David out of the hand of all his enemies.  Yet, when you set these two passages side by side, you can see that there are quite a few differences in these two chapters of the Bible.  Why is that?

The answer can be found in the first verse of 2 Sam 22 and the superscript of Ps 18.

2 Sam 22:1 says, “And David spake unto the Lord the words of this 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.”

The superscript of Ps 18 says, “To the chief musician, A Psalm of David, the servant of the Lord, who spake unto the Lord the words of this song in the day that the Lord delivered him from the hand of all his enemies, and from the hand of Saul: And he said.”

2 Sam 22 is the song that David wrote.  When he delivered it “to the chief musician” as “A Psalm of David,” he obviously made some revisions to the lyrics for musical accompaniment.  This is the common process of adapting the lyrics to the melody.

Both of these passages are the words of God.  They are not contradictions; they are not scribal errors.  They are two versions of the same song written by the same author.