The soul that has fulfilled its task, that has done what it has to do in terms of creating or repairing its own part of the world and realizing its own essence, can wait after death for the perfection of the world as a whole.
But not all the souls are so privileged.
Many stray for one reason or another.
Sometimes a person does not do all the proper things, and sometimes he misuses forces and spoils his portion and the portion of others.
In such cases the soul does not complete its task and may even itself be damaged by contact with the world.
It has not managed to complete that portion of reality which only this particular soul can complete.
And therefore, after the death of the body, the soul returns and is reincarnated in the body of another person and again must try and complete what it failed to correct or what it injured in the past.
–Rabbi Adin Steinsaltz