Śrīmad-Bhāgavatam · Text 4.29.61
Who is speaking and story frame
शयानमिममुत्सृज्य श्वसन्तं पुरुषो यथा ।
कर्मात्मन्याहितं भुङ्क्ते तादृशेनेतरेण वा ॥ ६१ ॥
śayānam imam utsṛjya
śvasantaṁ puruṣo yathā
karmātmany āhitaṁ bhuṅkte
tādṛśenetareṇa vā
The living entity, while dreaming, gives up the actual living body. Through the activities of his mind and intelligence, he acts in another body, either as a god or a dog. After giving up this gross body, the living entity enters either an animal body or a demigod’s body on this planet or on another planet. He thus enjoys the results of the actions of his past life.
Read Śrīla Prabhupāda's purport on Vedabase.io