In the last chapter of Psalms, it was covering Israel before the war, now the war is over and Israel has one, so these are celebratory Psalms of worship and praise for God who gave Israel the victory:
Psa 21:1 For the choir director: A psalm of David. How the king rejoices in Your strength, O LORD! He shouts with joy because You give him victory.
The king or general is happy because God has protected them and God gave Israel victory, again there is no glorifying the king, they are glorifying God who reigns over the king and allows the king to win.
Psa 21:2 For you have given him his heart’s desire; You have withheld nothing he requested. Interlude
God very generously endows the king with what the king asks, giving the king everything that he prayed for, the king came to God with a humble heart, the king put God first, they said they would praise God if they won the war, and now that they have defeated their enemies, they are glorifying God; God first, then the heads of state, God reigns supreme!