Śrīmad-Bhāgavatam · Texts 4.29.30-31
Who is speaking and story frame
क्षुत्परीतो यथा दीन: सारमेयो गृहं गृहम् ।
चरन्विन्दति यद्दिष्टं दण्डमोदनमेव वा ॥ ३० ॥
तथा कामाशयो जीव उच्चावचपथा भ्रमन् ।
उपर्यधो वा मध्ये वा याति दिष्टं प्रियाप्रियम् ॥ ३१ ॥
kṣut-parīto yathā dīnaḥ
sārameyo gṛhaṁ gṛham
caran vindati yad-diṣṭaṁ
daṇḍam odanam eva vā
tathā kāmāśayo jīva
uccāvaca-pathā bhraman
upary adho vā madhye vā
yāti diṣṭaṁ priyāpriyam
The living entity is exactly like a dog who, overcome with hunger, goes from door to door for some food. According to his destiny, he sometimes receives punishment and is driven out and at other times receives a little food to eat. Similarly, the living entity, being influenced by so many desires, wanders in different species of life according to destiny. Sometimes he is high, and sometimes he is low. Sometimes he goes to the heavenly planets, sometimes to hell, sometimes to the middle planets, and so on.
Read Śrīla Prabhupāda's purport on Vedabase.io