What I think happens when we sleep is that our conscious and subconscious get together. We may be in an out- of -body -state as well when we experience our dreams.
Death is like a longer night, when we get born again, we do not remember our previous lifes, but the real awakening comes when the knowledge we gathered during our past surfaces again. This is personal. One can have a gift for making music. The result of study in the past.
When we sleep we 'digest' the happenings of the day. To go without sleep is not a healthy thing, since our mind will start to confuse things, and one is less alert.
Ever noticed that time also seems to slow down when you are tired?
Everything an illusion? Yes, but while you are living in it , it is very real in time.