There is an indwelling Jiva (feebly translated as soul) within every living body.
Our physical body undergoes several modifications, but the Jiva does not.
The entire Dharma Sastra addresses the Jiva and makes one understand that "I am not the body, I am the Jiva".
The Jiva while leaving the physical body travels with the subtle body (or the mind) with it.
The result of our good and bad actions and the knowledge we have gained also travel with the Jiva.
In Kathopanishad (1-3-3,4) there is a beautiful explanation of the Jiva's Journey, popularly known as Ratha Kalpana.
Our body is the chariot,
Jiva is the Traveler,
Intellect is the Driver,
Mind is the reins,
Five sense organs are the horses,
Five sense objects are the paths.
If the horses are allowed to move freely, they will wander in their own path. A life led by solely the sense organs, will cause a great disaster.
Just as a driver, who decides the path and direction of the journey, and controls the vehicle ( the horses), our intellect should be well-informed and clear enough to handle the mind and the sense-organs.