All humans need to feel good, when it doesn't come naturally by ourselves, we give this power over us to either a certain external factor, person, behavior (Compulsions), or drug, to do it for us, for the reward of relaxation, feeling good with ourselves and about ourselves.
Obsessions/Intrusive thoughts literally are the Cravings for Compulsions (Immediate self-soothing, reassuring behavior, guilt, or any reaction that feeds the cycle "I am a bad person...").
I believe that if we trace to the roots of both conditions (addictions and OCD), both may have a component that stems mostly from insufficient self-love. In a way, it is kind of explaining why some people get easily addicted to certain behaviors, objects, drugs, meds, and alcohol while others don't.
That's why I believe that OCD is not only about recovery, but rather acquiring a new mindset for a lifetime of correct and healthy self-management, practicing everyday self-love, relaxation, and conquering fears. Replacing the fertile ground for anxiety. I hope that this understanding will allow us to add more coping skills and ways to recover.
By the way:
Noticed how the word trigger is used in the same way for drug craving?
The only difference is we are encouraged to gradually face triggers rather than avoidance (which is a compulsion)