Most of our Parasha is about how Joseph lands in Egypt but the episode of Tamar and her father-in-law Judah puncture the middle of this lengthy story. Why was this unrelated story allowed to break the flow of the Joseph story? Out of the problematic union of Judah and Tamar comes forth the lineage of King David – the redeemer of Israel. Joseph's journey to Egypt is the beginnings of Jewish exile. The Torah is telling us that although we're about to enter exile, our redemption has already been arranged – David's lineage is being prepared. The Torah wants us to know that the world is not without a plan or purpose, and God does not send us into suffering without already having a plan for how to save us.