Bg 13.22

puruṣaḥ prakṛti-stho hi
bhuṅkte prakṛti-jān guṇān
kāraṇaṁ guṇa-saṅgo ’sya
sad-asad-yoni-janmasu
Word for word: 
puruṣaḥ — the living entity; prakṛti-sthaḥ — being situated in the material energy; hi — certainly; bhuṅkte — enjoys; prakṛti-jān — produced by the material nature; guṇān — the modes of nature; kāraṇam — the cause; guṇa-saṅgaḥ — the association with the modes of nature; asya — of the living entity; sat-asat — in good and bad; yoni — species of life; janmasu — in births.
Translation: 
The living entity in material nature thus follows the ways of life, enjoying the three modes of nature. This is due to his association with that material nature. Thus he meets with good and evil among various species.
Purport: 

This verse is very important for an understanding of how the living entities transmigrate from one body to another. It is explained in the Second Chapter that the living entity is transmigrating from one body to another just as one changes dress. This change of dress is due to his attachment to material existence. As long as he is captivated by this false manifestation, he has to continue transmigrating from one body to another. Due to his desire to lord it over material nature, he is put into such undesirable circumstances. Under the influence of material desire, the entity is born sometimes as a demigod, sometimes as a man, sometimes as a beast, as a bird, as a worm, as an aquatic, as a saintly man, as a bug. This is going on. And in all cases the living entity thinks himself to be the master of his circumstances, yet he is under the influence of material nature.

How he is put into such different bodies is explained here. It is due to association with the different modes of nature. One has to rise, therefore, above the three material modes and become situated in the transcendental position. That is called Kṛṣṇa consciousness. Unless one is situated in Kṛṣṇa consciousness, his material consciousness will oblige him to transfer from one body to another because he has material desires since time immemorial. But he has to change that conception. That change can be effected only by hearing from authoritative sources. The best example is here: Arjuna is hearing the science of God from Kṛṣṇa. The living entity, if he submits to this hearing process, will lose his long-cherished desire to dominate material nature, and gradually and proportionately, as he reduces his long desire to dominate, he comes to enjoy spiritual happiness. In a Vedic mantra it is said that as he becomes learned in association with the Supreme Personality of Godhead, he proportionately relishes his eternal blissful life.