To elaborate on the question, I am assuming that in the beginning there was no Atma stuck in maya, is there any information on how the perfect Atma got stuck in Maya? Is my assumption wrong? To build on that, how can anything be eternal? Everything should have a start and end isn't it? Because something has to initiate first for the universe to be born, say big bang! and there are many theories on how the universe will end. Shouldn't there be something similar for brahman?
The Story of Creation
From Aitareya Upanishad
हरिः ॐ॥ आत्मा वा इदमेक एवाग्र आसीन्नान्यत्किञ्चन मिषत्। स ईक्षत लोकान्नु सृजा इति ॥
hariḥ om|| ātmā vā idameka evāgra āsīnnānyatkiñcana miṣat | sa īkṣata lokānnu sṛjā iti ||
In the beginning the Spirit was One and all this (universe) was the Spirit; there was nought else that saw. The Spirit thought, “Lo, I will make me worlds from out my being.”
Before the world was created all that existed was the Self, the Self alone. Nothing else was, nothing whatsoever stirred. Then the Self thought. “Let me create the worlds.” He brought forth the following worlds out of himself: Ambhas, the highest world, above the sky and upheld by it; Marichi, the sky; Mara, the mortal world, the earth; and Apa, the world beneath the earth. Ambhas is the highest world. It lies beyond the material realm. Marichi is space itself in which many suns and planets are to be found. Mara is not just planet earth, but any planet on which sentient beings live. Mara means death, and it is applied to the planets because all beings that live there are mortal. Apa is the name of the sub-material regions from which atomic matter rises. In a metaphysical sense Ambhas is the causal world, Marichi is the astral world, Mara is the physical world, and Apa is the region where those of low evolution go for a time after death–usually in a kind of sleep. Psychologically, Ambhas is the super-conscious mind, Marichi is the higher intelligence, or buddhi, Mara is the sensory, earth-centered mind or consciousness, and Apa is the subconscious mind. The God created all these worlds and then “He thought: ‘I have created the worlds, now let me bring forth their guardians.’ Then he created their guardians or lokapalas. A lokapala is the ruler or custodian of a world (loka). Therefore, he gathered the Purusha out of the waters and gave Him shape and substance.
As the Self brooded over the form, a mouth opened, as does an egg, giving forth speech and fire; nostrils opened with the power of breathing the air; eyes opened giving rise to sight and sun; ears opened to hear the sound in space; skin appeared and from it came hair and from it came plants and trees. The heart gushed forth and from heart came the mind, and from the mind came the moon. The navel broke forth and from the navel Apana, the downward force, and of Apana, Death was born. The organ of pleasure came forth and from the organ, seed; and of seed the waters were born.
These were the Gods that He created; they fell into this great Ocean, and Hunger and Thirst leaped upon them. Then they said to Him, “Command unto us a habitation that we may dwell secure and eat of food.” He brought unto them the cow, but they said, “It is not sufficient for us.” He brought unto them the horse, but they said, “It is not enough for us.” He brought unto them Man, and they said in joy, “O well fashioned truly! Man indeed is well and beautifully made.” Then the Spirit asked them to enter the body and take up their places. Then fire, becoming speech entered the mouth; air, becoming smell, entered the nose; the sun, becoming sight, entered the eyes; sounds in the space, becoming hearing, entered the ears; plants, herbs, and trees, becoming hair, entered the skin; the moon, becoming mind, entered the heart; Death became Apana, the lower breathing, and entered into the navel; the Waters became Seed or sperm and entered into the organ of pleasure. Now, hunger and thirst said to the Self, “Give us a place”. He told them to enter into these guardians and share their life with them. Thus hunger and thirst for food, drink and pleasure attend us, whatever we do in life.
The Self, Creator thought, “Here are the worlds and their guardians. Let me now bring forth food for them.” He brooded in might upon the waters. And from this appeared food in the form of matter. Food being created fled back from his grasp. He tried to seize it by speech, but failed; he then tried to catch it by breath, but could not; he tried to seize by the eyes, but in vain; then by the ears, by the skin, by mind, by the organ of pleasure, but all his efforts failed. Therefore, one cannot satisfy one’s hunger by merely speaking about food, smelling it, looking at it, hearing about it, touching it, not even by thinking about it. And finally he succeeded seizing food by the Apana, the breath of life. This is the seizer of food and therefore all that is Breath has its life in food.
This is the story of creation. And the Supreme creator, after having created everything entered into all and made all his habitation.
The problem with this question is - it needs a Guru to address it in person because this group expects literary references, which don't always provide the full context. Nevertheless, I'll stake my neck out and give an authentic answer.
Imagine a serene calm pond. When a pebble is dropped, concentric ripples begin to emerge and race to the shore - from a tiny ripple to a wave before it hits the shore. One can discern the wave from the pond because it has it's own shape and energy and attributes.
in the beginning there was no Atma stuck in maya
The question that is raised here is - at what point did the wave get it's distinct identity when it was plain serene water earlier? The answer to this is - it is a continuum - an interplay of time, karmic memory and energy (Shiva-Shakti Keli vilasam) which progresses all the way from the smallest of microbes till the human form and beyond... until the energy gets absorbed and the disturbance cedes and everything falls back into the same serene pond.
PS: I'm aware this answer may be downvoted but this is an abstraction and hence to find references, I have to study a lot of literature which needs lot of time. So feel free to downvote.
Edit 1: It is difficult to find references for Yogic Insights but we have such a large repository of scriptures that it can be found somewhere with painstaking searches. Thanks @Just_Do_It for the reference.