Psalm 3:1 King David sings even when oppressed

King David’s life was full of oppression. As a young boy by his brothers, afterwards by King Saul… but the worst of all, was the one by his own son Absalom , who wanted to rule over Israel in place of his father David.
This oppression is the story behind Psalm 3, as indicated in the first verse:

“מִזְמוֹר לְדָוִד בְּבָרְחוֹ מִפְּנֵי אַבְשָׁלוֹם בְּנוֹ”

“A song of David, when he fled from Absalom his son.”

Humiliated and painful, King David is forced to flee from his house, being chased by his own son and most of the people of Israel whom used to follow him, now following Absalom.
From the highest position in the world, to the lower point possible. From ruling everyone, to being chased by your own.

After this, we would expect a lamentation, not a ‘song’. “A lamentation of David”.
Despite the difficult and painful situation, King David has a strong personality, indeed leans on a firm cane. – Mentally wholeness, acceptance of the Lord’s righteously. As King David himself admits in the last verse of Psalm chapter 2 “..the praises of all who take refuge in Him.

“A song of David”