Genesis 38:20

And Judah sent the kid by the hand of his friend the Adullamite, to receive his pledge from the woman’s hand: but he found her not.

Judah sent his friend the Adullamite with the kid to take back his pledge from the woman's hand, but the friend found her not because Tamar had concealed her identity from Judah. The incident belongs to the account of the sin of Judah and his family, placed after Joseph was sold into Egypt and before Joseph was bought by Potiphar and then tempted and imprisoned. In that placement it illustrates the sad fruits of Jacob's mistakes, including low standards of morality and crime.

The account tells how Tamar acted the part of a harlot with her father-in-law Judah, and how Pharez was born by a harlot from that union. Pharez stands in the human ancestry of Christ, so that Christ's human lineage included people marked by moral weakness whose lives were not exemplary. That tainted birth helped concentrate all the weaknesses and sinful tendencies of fallen humanity in the family from which Christ took his flesh, so that Christ came with a human nature more subject to infirmities of the flesh because the race had deteriorated physically and morally, which was necessary that he might suffer death and sympathize with tempted humanity.

The record of Judah's sin is given to expose sin that readers may shun it, not to pander to lust nor to excuse wrongdoing, and it points to God's remedy through his love and mercy and power. For that reason the presence of such ancestors presents hope to the fallen.