The Psalmist calls from afar for deliverance to God (61:1~2), who has previously afforded it to him (v. 3), and he prays for shelter and protection in God's tent (v. 4), on the ground of previous special tokens of grace (v. 5). Upon this is based the prayer for special blessings for the king (61:6~7), for which the Psalmist will offer without cessation the thanksgiving he has vowed (v. 8).
David knows that God has heard his vows (61:5; 50:14~15). He has made them in his distress and lets God know that he has not forgotten them. David, in making a vow, is a picture of the Lord Jesus, Who made the vow to God to do His will (Hebrews 10:7; Psaln 40:7-8). He did not make His vow subject to any condition, but made it out of love and devotion to His God.
The Messiah perfectly feared God's Name and perfectly fulfilled His vow. As a reward for that, He received the inheritance that God gives to all those who fear His Name. Moreover, He also acquired the right to the inheritance through His work on the cross (Revelation 5:1-10). All who fear God will receive the inheritance because Jesus accomplished the work on the cross for them. As a result, Believers have also become heirs (Ephesians 1:10~11; 3:6).