In truth, matter and spirit (soul) already existed before being manifested. Their existence is simultaneous. The eternal beings eternally conceive innumerable desires and all the living species exist from all eternity to answer these varied desires. It is therefore the desires of spiritual beings that determine the bodies they must assume. Because God is omniscient, He knows perfectly well that certain living beings will rebel against his will and commit themselves to guilty acts. He also knows the varied desires that they will develop in contact with the three attributes and modes of influence of material nature; virtue, passion and ignorance. Thus, since the dawn of time, He has created the various living forms that will serve to shelter conditioned souls according to their desires. All the different objects of the material world are designed from these three attributes, just as the three basic colors (blue, red and yellow) are used to produce thousands of different shades and tones. As for the orchestration of this distribution, it is devolved to nature, which takes care of it with a prodigious dexterity. All activities are accomplished by these three attributes. Material influences are reflected in the variety of living species, plants and trees, fish, mammals, humans, celestial beings and others, 8,400,000 different forms of life.
The Supreme Lord Himself is multiplying to appear as the Supreme Soul in everyone's heart. Although He resides in the material body and is its original source, the Supreme Soul (also called the Holy Spirit) is not Himself material. For Him, there is no distinction between matter and spirit, because all energies proceed from Him. He can therefore, as he pleases, transform matter into spirit and mind into matter.
The Supreme Lord says, "That which penetrates the whole body is indestructible."
The Lord is there, referring to the soul. Now, what penetrates the whole body of a living being is consciousness and consciousness, it is the soul. And the state of our consciousness at the moment of death will determine the particular body that will be assigned to us in the next life. If you have the consciousness of a dog, you will have to put on the body of a dog, but if you have developed a divine consciousness, you will get the body of a celestial being. Krishna gives everyone the freedom to choose the body they want to wear. If a spiritual being incarnated in a human body does not attain liberation, he will not have to transmigrate through the 8,400,000 living species. According to the laws of nature, the spiritual being must undergo this gradual progression only in the inferior species. In the human form, his developed consciousness gives him the power of discernment. Therefore, a being who has a developed consciousness will not be reborn in an animal body, but will obtain another human body.