The compulsive behaviors are reinforced anxiety reduction. Learning theorists describe how people with high levels of anxiety learn to perform certain behaviors or rituals in order to decrease the perceived unpleasant sensation. This is explained by the operant conditioning, that is, we repeat the behavior that generates pleasant responses. However, compulsive behavior only helps to temporarily reduce anxiety, so the anxiety disorder increases.
I hope my answer can help you.