Srimad-Bhagavatam: Canto 10 - Chapter 1 - Verse 45


यथा शयान: पुरुषो मनसैवात्ममायया ।सृष्ट्वा लोकं परं स्वाप्नमनुविश्यावभासते ॥ ४५ ॥


yathā śayānaḥ puruṣomanasaivātma-māyayāsṛṣṭvā lokaṁ paraṁ svāpnamanuviśyāvabhāsate


The Lord is like a sleeping person who creates a separate world in his imagination and then enters his own dream and sees himself within it.


In the illusion of his dream, a sleeping person creates an apparent world, complete with cities populated by the fictional products of his imagination. In somewhat the same way, the Lord manifests the cosmos. Of course, the creation is not illusory for the Lord, but it is for those souls who are put under the control of His Māyā potency. As her service to the Lord, Māyā deludes the conditioned souls into accepting as real her temporary, insubstantial manifestations.