Having obsessions – like a loop stuck in the brain playing unpleasant thoughts over and over again.
When repeating rituals/actions over again it is like you cannot remember if you have performed the ritual correctly or done it the right amount of times like constantly rewinding your memory back (like video footage).
A friend of mine with OCD would ask people where she was at a certain date and time to retrace her steps to make sure she had not harmed someone. Even after being reassured she would continue to ask different people. It was like she did not trust her own memory. Scientist have carried out tests and found that the memory of people with OCD is fine but the anxiety caused by the OCD seems to shut memory down.