Genesis 38:12

And in process of time the daughter of Shuah Judah’s wife died; and Judah was comforted, and went up unto his sheepshearers to Timnath, he and his friend Hirah the Adullamite.

Genesis 38:12 belongs to the history of Joseph, which shows that whatever God has intended a person for, God can be safely trusted to bring them to it, for he may lead them round but he will guide them right. It is part of the account of the sad fruits of Jacob's mistakes, including the low standards of morality and crime that followed his having more than one wife. It is part of the account of Judah's sin, which is recorded to reveal sin so that it may be shunned, not to encourage or excuse it, while the account also points to God's love, mercy, and power as the remedy for sin.

Tamar, Judah's daughter-in-law, acted the part of a harlot with him, and Pharez born of that harlotry was an ancestor of Christ according to the flesh, making her part of the recorded ancestry of Christ. The human line from which Christ sprang through Jacob, David, Solomon, Rahab and the sinful kings of Judah contained selfishness, craft, deceit, harlotry, heathenism, weakness and idolatry, tending to concentrate in Christ all the weaknesses and sinful tendencies to which fallen human nature is subject. Although his mother was pure and godly, his human nature was more subject to infirmities of the flesh than if he had been born before the race had deteriorated physically and morally. This was not accidental but a necessary part of redemption, so that by taking the flesh of sinful man he could suffer death, suffer being tempted, and be able to sympathize with and succor those tempted through weakness of the flesh.