Doctors do not know the exact cause of OCD. Factors that may play a role include head injury, infections, and abnormal function in certain areas of the brain. Genes (family history) seems to play a strong role.
Most people who develop it show symptoms by age 30.