Sexual behavior in its various forms can be used to cause the release of chemicals in the brain which have the effect of taking the person away from unpleasant emotional states. Sexual behaviors can become obsessive when they are used in response to these unpleasant internal states to repeatedly block them through brain chemicals relating to pleasure, excitement, or numbing, depending on the type of behavior.
Chemicals released in the brain which relate to specific sexual functions are: dopamine, norepinephrine, serotonin, oxytocin, vasopressin, opioids and epinephrine. These have the ability to create a desired state of one kind or another, numbing, energy, fantasy/dissociation, or pain (releases opioids) which can be used to “self-medicate” undesirable feelings or traumatic reactivity of one sort or another.
Sexual acting out behavior is usually categorized into one of three types depending on the desired end state. (1) Arousal created by high-risk behaviors or high drama relationships, for example, act like cocaine and amphetamines (2) numbing created by behaviors such as compulsive masturbation mimics the effects of heroin or alcohol, and (3) fantasy or a trance-like state is achieved by behaviors such as obsession with internet pornography or fantasy charged situations which resembles sedation. Further, when the sex addict refrains from sex a predictable set of withdrawal symptoms arise. For more see This is Your Brain on Cyber Porn.