If brothers live together and one of them dies and has no son, his wife shall not be married outside the family to a stranger [an excluded man]. Her husband's brother shall go in to her and take her as his wife and perform the duty of a husband's brother to her.
Then Judah said to Tamar, his daughter-in-law, Remain a widow at your father's house till Shelah my [youngest] son is grown; for he thought, Lest perhaps [if Shelah should marry her] he would die also, as his brothers did. So Tamar went and lived in her father's house.
Turn back, my daughters, go; for I am too old to have a husband. If I should say I have hope, even if I should have a husband tonight and should bear sons,
But Onan knew that the family would not be his, so when he cohabited with his brother's widow, he prevented conception, lest he should raise up a child for his brother.