Śrīmad-Bhāgavatam · Text 10.1.41
Who is speaking and story frame
स्वप्ने यथा पश्यति देहमीदृशंमनोरथेनाभिनिविष्टचेतन: । दृष्टश्रुताभ्यां मनसानुचिन्तयन्प्रपद्यते तत् किमपि ह्यपस्मृति: ॥ ४१ ॥
svapne yathā paśyati deham īdṛśaṁ
manorathenābhiniviṣṭa-cetanaḥ
dṛṣṭa-śrutābhyāṁ manasānucintayan
prapadyate tat kim api hy apasmṛtiḥ
Having experienced a situation by seeing or hearing about it, one contemplates and speculates about that situation, and thus one surrenders to it, not considering his present body. Similarly, by mental adjustments one dreams at night of living under different circumstances, in different bodies, and forgets his actual position. Under this same process, one gives up his present body and accepts another [tathā dehāntara-prāptiḥ].
Read Śrīla Prabhupāda's purport on Vedabase.io