Onan was Judah's second son who was put to death by the Lord after deliberately refusing his family obligation to provide offspring for his deceased brother through Tamar.
Biography
After Er died childless, Judah instructed Onan to fulfill the duty of a brother-in-law by fathering offspring for Tamar on behalf of Er. Knowing that the resulting child would not be reckoned as his own heir, Onan repeatedly prevented conception while still taking Tamar sexually. Genesis states that what he did was wicked in the Lord's sight, and the Lord put him to death.
Biblical Significance
Onan's sin in its Genesis context is deliberate refusal of covenant-family responsibility combined with exploitation of Tamar, not merely a detached statement about a sexual act. His death advances the Judah-Tamar narrative leading to Perez.