38:24-26
However, things could not be let go. Tamar was pregnant, and the father was Judah, though he did not know that at the time. Initially it was naturally assumed that Tamar had been immoral. Indeed, she had been, but so had Judah, even more so. Tamar then sent the pledge items to her father-in-law Judah. On receipt of the pledge items Judah knows what has happened. At this point he responds in the proper way, acknowledging his own guilt, and declaring that Tamar is more righteous than him. He also admits that he should have given Shelah to her as a husband.
38:27-30
Tamar gave birth to twins, and there seems to have been something of a tussle. The twins are Perez and Zerah, and Perez will feature in Israel’s history. So in all this we see men and women carrying on in their sinful ways, but through it all, despite it all, the Lord’s plan progresses.