 Onan realized that any children he had wouldnt be his own, so whenever he slept with his brothers wife he made sure she wouldnt become pregnant by withdrawing and spilling his semen on the ground. In this way he prevented any children being born on behalf of his brother. 