Chapter 38 is about Judah and his family structure.  He has wives and the wives have son's but they die bc they were not pleasing to God, except for one, Shelah. Judah is left with one of his son's wives, Tamar and she is promised to Shelah but she is never given to him to wed. Tamar seeks her rightful place in the family and she ends up having children by Judah.