There are what in computer programming could be called software "loops". The brain may formulate such patterns by exposure to pleasurable stimulation. For example a person may form a sexual fetish if they come to associate a particular item with sexual pleasure. After a period of reinforcement, even the contemplation of the item starts a process of arousal.
It is possible that instead of pleasure, a similar loop might be formed in an attempt to avoid discomfort, such as associated with anxiety. A person may find a particular activity provides a feeling of control and hold at bay feelings of discomfort such that the repeat the action to obtain the relief from anxiety.
There might be medications and even supplements that bear on the feelings of pleasure or anxiety such that a degree of influence can be obtained, however, it is unlikely that such remedies would offer complete relief.
One might speculate that a conditions such as Aspergers with greater neurological sensitivity, speed, or complexity could find great occurrence and severity.
The advantage of Aspergers is that with a more pronounced interior mental life, there is a greater chance that one can reprogram disadvantageous processing.