What primarily gives rise to khiyar al-‘ayb?

Khiyar al-Ayb: Defects, Remedies and Waiver