OCD is sometimes called the "Doubter's Disorder" or "The Doubter's Disease". These phrases seem to sum up both the cause (in part) and the effects of OCD.
As a young person (and as an adult), I was riddled with self-doubt. I had very few friends and my self-esteem and self-confidence were very low. Once I became old enough for important responsibility my basement low self-confidence would bar me from ever believing I could perform a task without error. I had to do and redo simple tasks such as locking the front door or setting my alarm clock in order to convince myself that I had done them correctly. When my Mom noticed me doing these things she would say "Just don't do it anymore!" Why not! Shouldn't not relocking a door or not resetting an alarm clock be easy? I guess for normal people, it is.
For instance, this sadly humorous account of a bedtime ritual speaks for doubter's everywhere:
10:30 PM Arrive home late from play practice.
10:31 PM Lock the front door.
10:35 PM Go upstairs and get ready for bed.
11:00 PM Lay in bed and wonder if the door is really locked.
11:02 PM Go back downstairs and check to see if the door is locked.
11:03 PM See that the door is locked and proceed back upstairs to bed.
11:10 PM Lay in bed and worry that I really just unlocked the door when I checked the door the first time.
11:20 PM Proceed back downstairs to double check that the door is locked.
11:21 PM Unlock the door. Relock the door. Step back from the door and see that the door is locked.
11:23 PM Proceed back upstairs to bed.
11:30 PM Lay in bed and worry that the lock didn't entirely engage when I locked it the last time. Curse myself. Laugh a little at my weirdness.
11:35 PM Proceed back downstairs to triple check the door to make sure that it is locked.
11:36 PM Bend down and look that lock square in the eye. Check the space between the door and the frame to make sure that the bolt part of the lock engaged fully. Lock and relock the door a few more times watching the bolt traverse the space between the door and the door frame. Step back from the door, stand up and say "The door is now locked."
11:40 PM Go back upstairs to go to sleep.
11:45 PM Lay in bed and wonder if my alarm clock is set.......
You get the picture, right?
There are some parts to this scenario and the wiring of the human brain that make the above a very vicious circle.
1. Ever, ever, ever finding the door to be unlocked on a recheck became proof that the compulsion/ritual was required to make sure that the door would be locked at night.
2. Finding the door locked was always pleasing and my brain then gave me a little endorphin shot that my body became dependent on.
3. Either way...I was screwed.