From the teachings of Rabbi Yehudah Leib Ashlag
The worlds unfold
The worlds unfold until we arrive at the reality of this physical world where body and soul exist, and likewise a time of spoiling and a time of healing. Our body, which is formed from the will to receive for itself alone, comes forth from its root within the purpose of Creation but it passes via the framework of the worlds of uncleanness, as Scripture says, "A man is born like a wild ass" (Job 1:12). It remains subject to this framework until a person reaches thirteen years of age. This period is designated "the time of spoiling."
Then, from the age of thirteen onwards, through performing mitzvotwhich he or she does in order to give benefit to others and pleasure to the Creator, the person begins to purify the will to receive for oneself, which is inherent within them.
The person gradually transforms the will to receive for oneself alone into a will to give benefit. By this means, a person progressively attracts to themselves a holy soul from its root within the purpose of Creation. This soul passes through the framework of the worlds of holiness and enclothes itself within the body, and this is the time of healing.
The person carries on his spiritual quest
So the person carries on, continuing to acquire and attain higher levels of holiness drawn from the purpose of Creation within the Infinite. These higher levels of holiness help the person to transform the will to receive for oneself alone until it has entirely transformed into the will to receive in order to give pleasure to the Creator without including their own self-benefit. It is by this means, that the individual acquires affinity of form with the Creator. For receiving only for the purpose of giving to others or to G‑d is considered as having exactly the same form as pure giving.
Thus the person acquires complete unity with G‑d, because the spiritual unity is none other than the affinity of form. How could a person become united with Him except by becoming one with His qualities? It is by this means that a person becomes fit to receive all the good, the pleasantness and the tenderness that is implicit in the purpose of Creation.
So now we have clarified the healing of the will to receive that is inherent in the souls as a consequence of the purpose of Creation. For the sake of the souls, G‑d created the two frameworks described above, one opposed to the other, which the souls traverse, dividing into two aspects, body and soul, that enclothe one another.
The will to receive is transformed into the will to give
Through the practice of Torah and mitzvot, the will to receive is eventually transformed into the will to give. Then the souls are able to receive all the Good that is implicit in the thought of Creation. With this, they merit to a wondrous unity with G‑d, since they have earned affinity of form with their Creator through their work in Torah and mitzvot. This state is designated as the end of the healing process.
Then, since there will no longer be any need for the Other Side, the unclean side, it will disappear from the earth and death will be swallowed up forever. The work of Torah and mitzvot which is given to the totality of the world during the time period of its existence, and likewise, to each individual during the years of his or her life, has as its only purpose to bring us all to this final healing in which we come into affinity of form with the Divine.
Now we have also explained how the framework of the shells and uncleanness are created and emerge from G‑d's holiness. We have seen that this was necessary so as to allow the creation of the body which a person can subsequently heal through the work of Torah and mitzvot. If we did not have such bodies which contain within them the defective will to receive provided by the framework of uncleanness, we would never be able to heal it as one cannot heal anything one does not have within oneself.
[From "In the Shadow of the Ladder" by Mark and Yedidah Cohen]