"…It was about that time that Judah descended." (Gen. 38:1)

The paragraph describing a levirate marriage was appended to the paragraph describing the sale of Joseph, as both paragraphs deal with the subject of "gilgul", a form of reincarnation, complete transformation of one's fate. The sin committed by the brothers was of the type that could be atoned for by nothing less than reincarnation of their souls in different bodies. This is also the mystical dimension of the levirate marriage (when the widow of a man who died without having sired children marries one of his surviving brothers; compare Deut. 25:5-10).

By dying a martyr's death, the millennia-old sin overhanging them was finally expiated….

The mystical dimension of the levirate marriage is the same as the mystical dimension of reincarnation of the souls in a new body. The ten martyrs whom the Romans chose to expiate for the sin of the brothers having sold Joseph were none other than reincarnations of the brothers' souls in different bodies. By dying a martyr's death, the millennia-old sin overhanging them was finally expiated.

Er and Onan, the sons of Judah who died prematurely for committing a sin, were similarly reincarnated in the bodies of Judah and Tamar's twin sons Peretz and Zerach (verse 29). This is the deeper meaning of the sequence, "Er and Onan died in the land of Canaan, and the sons of Judah were..." (Num. 26:19-20) Here, too, this secret is alluded to through the sequence in which the Torah relates these events, something which the intelligent reader will comprehend.

[Selected with permission from the seven-volume English edition of "The Torah Commentary of Rebbeinu Bachya" by Eliyahu Munk.]