The sons of God here in Deuteronomy 32:8 are the same sons of God from Genesis 6. Rebel princes (angels) of God's divine council who came down and beguiled human women into idolatry and sex, birthing the race of giants (from whom Goliath descends, and surely where earth hero mythology originates).
Note that this division of the nations occurs right after the tower of Babel. That tower wasn't for climbing into the atmosphere, it was a religious monument aimed at divining the sons of God as the earth was rife with demon worship at the time (it was also the birth of globalism, which failed and which Satan has been trying to reverse ever since). Viz. Matthew 24:37, as it was in the days of Noah so shall it be at the coming of the Son of Man. He who hath an ear let him hear.
So God wiped out the giants and the humans who worshipped them, save for Noah et al. But it was also a supernatural judgment as 2 Peter 2:4 hints at and Ezekiel 31:15 elaborates:
15 “Thus says the Lord God: On the day the cedar  went down to Sheol I caused mourning; I closed the deep over it, and restrained its rivers, and many waters were stopped. I clothed Lebanon in gloom for it, and all the trees of the field fainted because of it. 16 I made the nations quake at the sound of its fall, when I cast it down to Sheol with those who go down to the pit. And all the trees of Eden, the choice and best of Lebanon, all that drink water, were comforted in the world below
Further back from verse 3 it says:
"3 Behold, Assyria was a cedar in Lebanon,
with beautiful branches and forest shade,
and of towering height,
its top among the clouds. 
4 The waters nourished it;
the deep made it grow tall,
making its rivers flow
around the place of its planting,
sending forth its streams
to all the trees of the field.
5 So it towered high
above all the trees of the field;
its boughs grew large
and its branches long
from abundant water in its shoots.
6 All the birds of the heavens
made their nests in its boughs;
under its branches all the beasts of the field
gave birth to their young,
and under its shadow
lived all great nations.
7 It was beautiful in its greatness,
in the length of its branches;
for its roots went down
to abundant waters.
8 The cedars in the garden of God could not rival it,
nor the fir trees equal its boughs;
neither were the plane trees
like its branches;
no tree in the garden of God
was its equal in beauty.
9 I made it beautiful
in the mass of its branches,
and all the trees of Eden envied it,
that were in the garden of God.
Now obviously Assyria and Lebanon were not in Eden and did not go down to sheol. The rebel angels "who abandoned their first estate", who saw that the daughters of men were attractive, did. Assyria and Lebanon are motifs used to ascribe nations to the evil angelic powers that govern them. The same thing is done in chapter 28, addressing Pharaoh and the King of Tyre as Satan (the first two weren't in Eden either). This is prophetic allegory, ascribing human powers to the demons behind them as though they were the same thing - which they are as Deuteronomy 32:8 shows us that the nations were literally handed over to demonic control.
Also the "trees" are emblems for the fallen angels, interchangeable with the "sons of God". Hence in fact the correct interpretation of Genesis 3 is that the tree of the knowledge of good and evil was actually Satan. And he wasn't the only "son of God" there, as after the fall Adam and Eve hid themselves amongst the other "trees" (they didn't hide in a literal forest). Thus eating or partaking of his "fruit" was the first act of idolatry, the first act of demonic worship. In spite of God, Eve prostituted herself to Satan in exchange for power. She made him her god and there's every reason to suspect that the fornication wasn't merely spiritual, but also physical (sexual). Their awareness of their nakedness certainly alludes to this, and then in Genesis 6 we read the other demons likewise seduce more women in emulation of their master.
Is it any wonder why "thou shalt have no other gods before me" and "thou shalt not covet" are in the ten commandments?
The flood then is God wiping the apostate earth populace, human and demi-god, off the face of the earth, and consigning those angels responsible to a special supernatural jail (the abyss). This place strikes terror amongst demons to the point of fainting (Ezekiel 31:15), and centuries later with Legion begging Jesus not to send them there (Luke 8:31).
However afterwards the giants come back, and the descendants of Noah seek the sons of God all over again at Babel.
So enter Deuteronomy 32:8, God gives them over to what they want…which is to worship the fallen angels, the "gods", and he carves up the world into nations and assigns each of them to one or more of the fallen angels. Save for his portion, which was Jacob or Israel. He would do this again later when Israel demands a king to rule over them like the other pagan nations. The kingdom of Saul is a direct mirroring of the heavenly saga, and this is why much of David's Psalms are eschatological. God showed David through revelation and in the experience of his own life, the cosmic saga being played out in the heavenly realm. He also saw premonitions of Christ. Hence David is among the prophets.