Maya is a mistake which creates for some the illusion that it is the only reality .In Hinduism one must be able to come out of Maya in order to achieve
Moksha (liberation of the soul from the cycle of death and rebirth. Ahamkar(ego consciousness)and karma are seen as part of binding forces of Maya . Maya is seen as the phenomenal universe, a lesser reality-lens superimposed on the one Brahman that leads us to think of the phenomenal cosmos as real. Through the force of illusion Maya spells a charm and keeps things under its sway. The word maya originally referred to the wizardry with which a god can make human beings believe in what turns out to be an illusion and its philosophical sense is an extension of this meaning.
In Advaita Vedanta philosophy maya is the limited ,purely physical and mental reality in which our everyday consciousness gets entangled .It is a veiling of the existent true unitary self -the Cosmic Spirit also known as
Brahman .

The concept of Maya was expounded in the Hindu scriptures known as the Upanishads.The Brahman is the only truth and therefore maya is not the truth .The two principle functions of Maya are -to cover up the Brahman and hide it from our mind .The other is to present the material world instead of Brahman . Just as this illusion gets destroyed when true knowledge of the rope is perceived, similarly, Maya gets destroyed for a person when they perceive Brahman with transendental knowledge.
In the
Bhagavad Gita Lord Krishna adviced
Arjuna on the battlefield of Kurukshetra about Maya. In Chapter 14 Verse 3 of the Bhagavad Gita Krishna said"My womb is the great Nature (Prakriti or MAYA). In that I place the germ (embryo of life). hence is the birth of all beings".It explained that Prakriti (Nature)made up of three qualities (Sattwa, Rajas and Tamas), is the material cause of all beings.