Srimad-Bhagavatam: Canto 3 - Chapter 1 - Verse 11


अथ तस्याभितप्तस्य कतिधायतनानि ह ।निरभिद्यन्त देवानां तानि मे गदत: श‍ृणु ॥ ११ ॥


atha tasyābhitaptasyakatidhāyatanāni hanirabhidyanta devānāṁtāni me gadataḥ śṛṇu


Maitreya said: You may now hear from me how the Supreme Lord separated Himself into the diverse forms of the demigods after the manifestation of the gigantic universal form.


The demigods are separated parts and parcels of the Supreme Lord, as are all other living entities. The only difference between the demigods and the ordinary living entities is that when the living entities are rich in pious acts of devotional service to the Lord, and when their desire to lord it over material energy has vanished, they are promoted to the posts of demigods, who are entrusted by the Lord with executing the management of the universal affairs.