But Onan did not want Tamar to give birth to his child. He knew that the child would not belong to him. So when he had sex with his brother's wife Tamar, he made his semen go onto the ground. Onan did this so that Tamar would not give birth to a child for his dead brother.