Lord Krishna in Bhagavad Gita says continuity in cosmic system is part of cosmic design. After death of present body the release the soul atman, spirit within manifests a new body to start a new journey of life. The soul atman remaining same, it simply manifests a new body.
This process of migration from one body to another, in spiritual terms the soul atman manifesting a new body is called rebirth, reincarnation in Hinduism.
The whole process of reincarnation, rebirth was automatic. Based on residual balance of karma at the time of death the released soul atman manifested the new form. Only when matching parents are not available on mother earth the soul atman hibernated in heaven or hell.
Sooner matching parents become available on mother earth; the hibernating soul atman immediately manifests a new body and starts a new cycle of life. As per Bhagavad Gita it is the child that chooses its parents and not vice versa as popularly believed.
The whole cosmic system is directly governed by inscrutable laws of evolution and karma. Only when indulging in spirituality human beings succeed reaching state of enlightenment, the cycle of birth and death finally ends. The soul atman finally gains absolute purity forever.
In absence of dross impurities within, the need for soul atman to manifest a new human body ceases to exist. With human beings gaining enlightenment, reincarnation of the soul ends.
Contrary to popular belief it is not the human form that manifests a soul atman. The present earthly body is limited to present earthly span of life. We must never forget we had only one life to live, the present earthly domain.
In the next journey of life we as a soul atman would manifest an entirely new body and continue reincarnating again and again until practicing spirituality we reached god.