The Messiah is descended from Judah through his and Tamar’s son Peretz. In order to understand why it was necessary for the Messiah to enter the world in such a seemingly scandalous way, we need to recall that G‑d only created evil in order for there to be free choice. In order for free choice to exist, the forces of evil and the forces of good have to be perfectly balanced.
When the messianic line was about to enter the world, the forces of evil “argued” that the balance was about to be tipped against them. Therefore, the union that would bear the ancestor of the Messiah had to occur in a way that the forces of evil would consider beneficial to them. Just as in military strategy, an army sometimes pretends to retreat in order to draw the enemy into a vulnerable position, the forces of holiness here yielded a seeming victory to the forces of evil in the form of this seemingly sinful act, in order to gain the upper hand.1
Join the Discussion