It can be that even though a person has a single, pure, and elevated Nefesh, he may become angry and it will leave him. A lesser Nefesh will then replace it. Or, he may contract a terrible sickness, and an exchange of souls may occur. Or, he may contract a debilitating illness, and his Nefesh may be exchanged and go to another person, while he receives a different Nefesh. This is the secret of what is said, "A righteous person all of his life, only to become evil in the end" (Berachot 29a).

Differences consequent upon the variant levels of soul can be tremendous. Look what can happen when a person becomes angry or seriously ill. His soul can be switched from a higher one to a lower one.

…the roots of their souls are from much lower places in the soul body of the human race…

Then his behavior may change accordingly from moral to immoral, and to such an extent that it would be said about him, "A righteous person all of his life, only to become evil in the end."

This is also true in a more general way concerning the earlier and later generations. The spiritual levels of the later generations are much lower than the earlier generations, and their behavior is much less righteous. This is because the roots of their souls are from much lower places in the soul body of the human race than those of the earlier generations. Thus, if the soul body of Adam is considered one partzuf and one lifetime, then it could also be said of it, "A righteous person all his life, only to become evil in the end."

Or, just the opposite may occur.

In the lifetime of individuals something may happen to cause the soul of a wicked person to be exchanged for one of a higher grade. He will then finish his life as a righteous person.

Having said this, it is also possible for a woman who was originally meant to be the wife of a particular person, but his soul gets switched and she becomes the wife of the other person [into whom his soul migrated].

Several times in the Gate of Reincarnations, the relationship of man and wife has been compared to that of the soul and the body. Accordingly, it may be that the Rav is implying that souls which are switched because of some sin or sickness may be switched more or less permanently like where a wife who goes to another person.

[Commentary by Shabtai Teicher.]