Enlightenment talked about in religious texts is nothing but the realization that you are not the body but ever-existent consciousness. Then again this is not the result of any intellectual deliberation but rather the certainty that comes from experiencing yourself as such. We experience ourselves as the body. On the other hand the enlightened person experiences himself as consciousness external to all creation.

Going into samadhi itself is not unlike the death-process. You might even say that it is a simulation of it. The senses become increasingly diminished as the mind is withdrawn from them, the heartbeat slows, breathing slows down, the hands and feet grow cold, the body becomes stiff and seems as if dead, the flow of thought is cut off; even as life-force is withdrawn from every part of the body.

“Well then,” I said to myself, “this body is dead. It will be carried stiff to the burning ground and there burnt and reduced to ashes. But with the death of this body am I dead? Is the body I? It is silent and inert but I feel the full force of my personality and even the voice of the “I” within me, apart from it. So I am Spirit transcending the body. The body dies but the Spirit that transcends it cannot be touched by death. That means I am deathless Spirit.” All this was not dull thought; it flashed through me vividly as living truth, which I perceived directly, almost without thought-process. “I” was something very real, the only real thing about my present state, and all the conscious activity connected with my body was centered on that “I”. From that moment onwards the “I” or Self focused attention on itself by a powerful fascination. Fear of death had vanished once and for all. Absorption in the Self continued unbroken from that time on. Other thoughts might come and go like the various notes of music, but the “I” continued like the fundamental Sruti note that underlies and blends with all the other notes. Whether the body was engaged in talking, reading or anything else, I was still centered on “I”. Previous to that crisis I had no clear perception of my Self and was not consciously attracted to it. I felt no perceptible or direct interest in it, much less any inclination to dwell permanently in it.  – Sri Ramana Maharshi

In what is termed mahasamadhi, there is no returning from the samadhi experience and the enlightened being finally leaves the body voluntarily and consciously.