1 Wherefore did the heathen rage, and the nations imagine vain things?
2 The kings of the earth stood up, and the rulers gathered themselves together, against the Lord, and against his Christ;
3 saying, Let us break through their bonds, and cast away their yoke from us.
4 He that dwells in the heavens shall laugh them to scorn, and the Lord shall mock them.
5 Then shall he speak to them in his anger, and trouble them in his fury.
6 But I have been made king by him on Sion his holy mountain,
7 declaring the ordinance of the Lord: the Lord said to me, You are my Son, today have I begotten you.
8 Ask of me, and I will give thee the heathen [for] your inheritance, and the ends of the earth [for] your possession.
9 You will rule them with a rod of iron; you will dash them in pieces as a potter’s vessel.
10 Now therefore understand, you kings: be instructed, all you that judge the earth.
11 Serve the Lord with fear, and rejoice in him with trembling.
12 Accept correction, lest at any time the Lord be angry, and you should perish from the righteous way: whensoever his wrath shall be suddenly kindled, blessed are all they that trust in him.
(not KJV)
---
I think its a mixture of:
a) David's personal life and surrounding nations wanted to be free of service to Israel, in those times, till verse 6
b) inspired parts about Jesus Christ, starting in verse 7
So it has two layers.