Origin of Demigods from the Universal form of Supreme Lord!
From Srimad Bhagavatam (Canto-3, Ch-6)
This is how the Supreme Lord separated Himself into the diverse forms of the demigods after the manifestation of the gigantic universal form:
Agni, or heat, separated from His mouth, and all the directors of material affairs entered into it in their respective positions. By that energy the living entity expresses himself in words.
When the palate of the gigantic form was separately manifested, Varuṇa, the director of water in the planetary systems, entered therein, and thus the living entity has the facility to taste everything with his tongue.
When the Lord’s two nostrils separately manifested themselves, the dual Aśvinī-kumāras entered them in their proper positions, and because of this the living entities can smell the aromas of everything.
Thereafter, the two eyes of the gigantic form of the Lord were separately manifested. The sun, the director of light, entered them with the partial representation of eyesight, and thus the living entities can have vision of forms.
(Start of Creations by Krishna thru different manifestations! READ HERE!)
When there was a manifestation of skin separated from the gigantic form, Anila, the deity directing the wind, entered with partial touch, and thus the living entities can realize tactile knowledge.
When the ears of the gigantic form became manifested, all the controlling deities of the directions entered into them with the hearing principles, by which all the living entities hear and take advantage of sound.
When there was a separate manifestation of skin, the controlling deities of sensations and their different parts entered into it, and thus the living entities feel itching and happiness due to touch.
When the genitals of the gigantic form separately became manifest, then Prajāpati, the original living creature, entered into them with his partial semen, and thus the living entities can enjoy sex pleasure.
The evacuating channel separately became manifest, and the director named Mitra entered into it with partial organs of evacuation. Thus the living entities are able to pass stool and urine.
Thereafter, when the hands of the gigantic form separately became manifested, Indra, the ruler of the heavenly planets, entered into them, and thus the living entity is able to transact business for his livelihood.
Thereafter the legs of the gigantic form separately became manifest, and the demigod named Viṣṇu [not the Personality of Godhead] entered with partial movement. This helps the living entity move to his destination.
When the intelligence of the gigantic form separately became manifest, Brahmā, the lord of the Vedas, entered into it with the partial power of understanding, and thus an object of understanding is experienced by the living entities.
After that, the heart of the gigantic form separately manifested itself, and into it entered the moon demigod with partial mental activity. Thus the living entity can conduct his mental speculations.
(TEN PRIMARY SUBJECT MATTERS IN BHAGAVATAM! READ HERE!)
Thereafter the materialistic ego of the gigantic form separately manifested itself, and into it entered Rudra, the controller of false ego, with his own partial activities, by which the living entity transacts his objective actions.
Thereafter, when His consciousness separately manifested itself, the total energy, mahat-tattva, entered with His conscious part. Thus the living entity is able to conceive specific knowledge.
Thereafter, from the head of the gigantic form, the heavenly planets were manifested, and from His legs the earthly planets and from His abdomen the sky separately manifested themselves. Within them the demigods and others also were manifested in terms of the modes of material nature.
The demigods, qualified by the superexcellent quality of the mode of goodness, are situated in the heavenly planets, whereas the human beings, because of their nature in the mode of passion, live on the earth in company with their subordinates.
Living entities who are associates of Rudra develop in the third mode of material nature, or ignorance. They are situated in the sky between the earthly planets and the heavenly planets.
The Vedic wisdom became manifested from the mouth of the virāṭ, the gigantic form. Those who are inclined to this Vedic knowledge are called brāhmaṇas, and they are the natural teachers and spiritual masters of all the orders of society.
Thereafter the power of protection was generated from the arms of the gigantic virāṭ form, and in relation to such power the kṣatriyas also came into existence by following the kṣatriya principle of protecting society from the disturbance of thieves and miscreants.
The means of livelihood of all persons, namely production of grains and their distribution to the prajās, was generated from the thighs of the Lord’s gigantic form. The mercantile men who take charge of such execution are called vaiśyas.
Thereafter, service was manifested from the legs of the Personality of Godhead for the sake of perfecting the religious function. Situated on the legs are the śūdras, who satisfy the Lord by service.
All these different social divisions are born, with their occupational duties and living conditions, from the Supreme Personality of Godhead.
(King Parikshit Punishes Kali Purusha! READ HERE!)