Param Pujya Dada Bhagwan, an enlightened being explains how this process actually works!

The Soul is eternal; it is free from birth and death. However, the physical body, in which the Soul resides, is mortal. The moment Soul exits from the body, the body becomes lifeless. And this is what is termed as death.
As soon as the Soul leaves the body, the body is declared dead; and the Soul goes straight to its new destination where rebirth takes place.

When it is time for the Soul to depart from the body, meaning at the time of death, the circumstances and the events so gather that the Soul enters the new body first and then leaves the old body instantaneously.
However, the Soul does not leave alone - it, along with the Causal Body and the Electrical Body, together leave the old physical body. While the causal body is made up of the karmas accumulated through this life, the electrical body is for carrying out the bodily functions like seeing, eating and other physiologic activities in the new life.

The Soul has the property of expansion and contraction; so it can stretch as far as it has to. It has to go where it has karmic ties, as decided by the causal body. So when it begins to enter the new body over there, simultaneously it is leaving the old body here. Just as a snake leaves its burrow; part of it is outside the burrow and the other part is inside, until there comes a point when the snake is totally out. It is similar to that!
Upon leaving the present body, the future birth takes place in one of the four potential realms, namely:
Human–If we have lived our life being decent and humane, we are reborn as a human being.

The Animal Kingdom–If, in this life, our Intentions and our actions have been devious, if we have put our intellect to bad use like cheating people or taking away from people things that are not rightfully ours, especially money and women which do not belong to us, then the animal kingdom could be our next place of birth.
Hell – If we have spent our life destroying lives of others for our petty personal gains, then most likely, hell could be our next birth.

Celestial – If we have lived our life like a superhuman, putting the needs and happiness of others before our own, never hurting others through one’s mind, speech or body, regardless of what others’ behaviour is, then there is every chance that we are born as a celestial being.
Of the above-stated four life-forms, to be born as a human being is considered to be extremely auspicious because only in human birth, we have a chance to accumulate merit karma and consequently progress spiritually higher. Furthermore, it is only in human form that we can attain Self-Realization and also achieve ultimate liberation i.e. freedom from the perpetual cycle of birth and rebirth.

Akram Vignan – the instant path to Self-Realization
In every life, we have remained ignorant of the Self, our real Self. From childhood, people give us knowledge, “Hey, you are John (the reader may insert his own name here), you are son of so and so, you are Doctor, etc.” and accordingly, we begin to believe so, “I am John, I am son, I am Doctor.” This wrong belief is called ignorance of the Self!

On the path of Akram Vignan, the stepless path to instant Self-Realization, when Gnani, the Enlightened One, comes, and He gives us the knowledge that really, ‘I am a Pure Soul’, our ignorance takes an exit. Thus, here, we attain Self-realization through mere grace of the Living Gnani, the enlightened being.

If interested, you shall find more information at https://www.dadabhagwan.org/self-realization/

Author's Bio: 

Ambalal M. Patel was a civil contractor by profession. In June 1958, spontaneous Self-Realization occurred within Ambalal M. Patel. From this point on, Ambalal became a Gnani Purush, and the Lord that manifest within him became known as Dada Bhagwan. A Gnani Purush is One who has realized the Self and is able help others do the same. Param Pujya Dada Bhagwan used to go from town to town and country-to-country to give satsang (spiritual discourse) and impart the knowledge of the Self, as well as knowledge of harmonious worldly interactions to everyone who came to meet him. This spiritual science, known as Akram Vignan, is the step-less path to Self-realization.