The note on this one is that David wrote it after running from Saul for all those years.
1I love you, O LORD, my strength.
2The LORD is my rock and my fortress and my deliverer,
my God, my rock, in whom I take refuge,
my shield, and the horn of my salvation, my stronghold.
3I call upon the LORD, who is worthy to be praised,
and I am saved from my enemies.
6In my distress I called upon the LORD;
to my God I cried for help.
From his temple he heard my voice,
and my cry to him reached his ears.
7Then the earth reeled and rocked;
the foundations also of the mountains trembled
and quaked, because he was angry.
8Smoke went up from his nostrils,b
and devouring fire from his mouth;
glowing coals flamed forth from him.
9He bowed the heavens and came down;
thick darkness was under his feet.
10He rode on a cherub and flew;
he came swiftly on the wings of the wind.
11He made darkness his covering, his canopy around him,
thick clouds dark with water.
12Out of the brightness before him
hailstones and coals of fire broke through his clouds.
13The LORD also thundered in the heavens,
and the Most High uttered his voice,
hailstones and coals of fire.
14And he sent out his arrows and scattered them;
he flashed forth lightnings and routed them.
15Then the channels of the sea were seen,
and the foundations of the world were laid bare
at your rebuke, O LORD,
at the blast of the breath of your nostrils.
16He sent from on high, he took me;
he drew me out of many waters.
17He rescued me from my strong enemy
and from those who hated me,
for they were too mighty for me.
18They confronted me in the day of my calamity,
but the LORD was my support.
19He brought me out into a broad place;
he rescued me, because he delighted in me.
20The LORD dealt with me according to my righteousness;
according to the cleanness of my hands he rewarded me.
21For I have kept the ways of the LORD,
and have not wickedly departed from my God.
22For all his rulesc were before me,
and his statutes I did not put away from me.
23I was blameless before him,
and I kept myself from my guilt.
24So the LORD has rewarded me according to my righteousness,
according to the cleanness of my hands in his sight.
25With the merciful you show yourself merciful;
with the blameless man you show yourself blameless;
26with the purified you show yourself pure;
and with the crooked you make yourself seem tortuous.
27For you save a humble people,
but the haughty eyes you bring down.
28For it is you who light my lamp;
the LORD my God lightens my darkness.
29For by you I can run against a troop,
and by my God I can leap over a wall.
30This God—his way is perfect;d
the word of the LORD proves true;
he is a shield for all those who take refuge in him.
31For who is God, but the LORD?
And who is a rock, except our God?—
32the God who equipped me with strength
and made my way blameless.
33He made my feet like the feet of a deer
and set me secure on the heights.
34He trains my hands for war,
so that my arms can bend a bow of bronze.
35You have given me the shield of your salvation,
and your right hand supported me,
and your gentleness made me great.
36You gave a wide place for my steps under me,
and my feet did not slip.
37I pursued my enemies and overtook them,
and did not turn back till they were consumed.
38I thrust them through, so that they were not able to rise;
they fell under my feet.
39For you equipped me with strength for the battle;
you made those who rise against me sink under me.
40You made my enemies turn their backs to me,e
and those who hated me I destroyed.
41They cried for help, but there was none to save;
they cried to the LORD, but he did not answer them.
42I beat them fine as dust before the wind;
I cast them out like the mire of the streets.
43You delivered me from strife with the people;
you made me the head of the nations;
people whom I had not known served me.
44As soon as they heard of me they obeyed me;
foreigners came cringing to me.
45Foreigners lost heart
and came trembling out of their fortresses.
46The LORD lives, and blessed be my rock,
and exalted be the God of my salvation—
47the God who gave me vengeance
and subdued peoples under me,
48who rescued me from my enemies;
yes, you exalted me above those who rose against me;
you delivered me from the man of violence.
The note does a great job of setting up a good expectation for what this psalm is about. The title that is given to it for the sake of the translation is good, but the note is really what sets it up. David is no longer running from Saul and no longer in trouble and is taking his throne and he has plenty to be thankful for. God really has stood by him in a way that most people wouldn’t recognize, that it was all sunshine and roses for him while he was on the run. I suppose that’s a bit of the point. It wasn’t easy to be on the run, but he was listening to God and knew that God was his ultimate supporter and that things would work out.
Some of the talk about his own righteousness has been a fairly consistent theme throughout the psalms so far and it strikes me as strange while making sense out of why it was so important to detach what you think of as your own righteousness from salvation. It’s not really being saved if you could have done it for yourself.
It’s actually a copy (with some minor changes in some translations) of the song of praise at the end of 2 Samuel.