Vs. 1-3 show that enemies afflict, but God is our safe haven;
Vs. 4-8 confirm that God hears and responds to the earnest, penitent plea of His wounded warrior.
The incidents that drove King David to his knees in this Psalm are written in 2 Samuel 11-18. Because of David’s adultery and murder, his family was cursed by God. Absalom, his son, brought the sword to David’s life, and this self-inflicted pain never left David’s heart.
David is a shining example to God’s people for all times that, no matter what sins they have committed through weakness, God will forgive when they repent (Psalm 3:4). David’s security was in his faith in God to help him. So it is for Christians today (Hebrews 13:5-6).
That “salvation belongs to the LORD” is echoed in Revelation 7:10; 19:1. That’s why “there [is no] salvation in any other, for there is no other name under heaven given among men by which we must be saved” than Jesus Christ (Acts 4:10,12). No individual, group, or government has a name that saves like Jesus Christ (Acts 2:36-38; Matthew 28:18-20).