A person is made of the ever-changing five aggregates. Each aggregate acts and changes independently of the other four. When a person dies, the body (rupa) will stop functioning. With the body (rupa) stopping functioning, so are feelings, perception, fabrications (mental or physical), and the first seven levels of the nine consciousness.
Five Aggregates (五蘊, 오온)
1. Form, body (Rupa, 색온, 色蘊) - made of earth, water, sun, air (지수화풍, 地水火風)
2. Feeling (Vedana, 수온, 受蘊) The sensory process of experiencing feelings such as pain or pleasure
3. Perception (Sanna, 상온, 想蘊) The process of representation (thinking) through which objects are perceived and conceptualized
4. Fabrications (Sankhara, 행온, 行蘊) Mental operations and executive functions, such as volition and desire
5. Consciousness (Vijñāṇa, 식온, 識蘊) - discern, aware. The totality of mind and consciousness responsible for knowing and discerning objects
Nine levels of Consciousness
5-2. Ear (hearing) consciousness
5-3. Nose (smell) consciousness
5-4. Tongue (taste) consciousness
5-5. Body (touch/sensory) consciousness
5-6. Mental consciousness (mano-vijñāna)
5-7. Ego consciousness (manas-vijñāna)
5-8. Storehouse consciousness (ālaya-vijñāna)
5-9. Pure consciousness (amala-vijnana)—this is the state of nibbana. Obviously only an extremely small number of people reach this stage by the time of their deaths.
Everyone possesses one's own eternal storehouse consciousness of karma. That is the 8th consciousness (alaya-vijnana) that never dies or is destroyed except for very, extremely few. It often compares to a stream that never dries up. The eighth consciousness is like water, never the same water, that keeps flowing in a stream. This is why the 8th consciousness is sometimes referred to as the karmic stream, a stream that is always flowing and changing.
Ālaya-vijñāna is also compared to seeds (bija), karmic seeds that sprout to a new life when their preceding life ends.
Here, the 8th consciousness is anatta (not-self), not atman (soul). The karmic stream (alaya-vijnana) is defiled mind consciousness, so whatever karmic seeds (bija) are stored in its own storehouse will sprout when certain conditions are met for that seed to sprout.
The first five consciousnesses are easy to understand. These are consciousnesses before a thought arises.
The 6th is mental (thought) consciousness and is the brain consciousness that acts as the CPU of a computer and processes all the incoming data from the first five consciousnesses sent to the 6th consciousness. It is only consciousness that is able to think, imagine, conceptualize, and attach emotional values (happy, sad, worry, and hope).
The 7th, ego consciousness, is like the sixth consciousness gone awry. This is the consciousness that erroneously takes ownership of all the happening of the six consciousnesses as his permanently possessed as his own, "I."
This is the consciousness that defiles and contaminates the original, pure, unconditioned "self," the 9th amala-vijnana, so that the samsara cycle continues.
When a person dies, the first seven consciousnesses stop their activities, and whatever information is stored in the first seven consciousnesses gets completely erased.
Only the 8th alaya-vijnana is the sub-consciousness that survives, continues, and never dies through an infinite cycle of samsara (rebirth). This is the storehouse consciousness that warehouses all the karmas accumulated from the very beginning.
This is the consciousness that determines which karmic seeds, bija, will sprout when, where, how, and in what form.
This consciousness works independently of the first seven consciousnesses, as it is a mental motion set in motion by energy accumulated over aeons of karma.
Thus, the 9th amala-vijnana, pure consciousness, is just the 8th storehouse consciousness, alaya-vijnana, that is completely empty of all karmic seeds. This is the consciousness state of Nirvana.