Dopamine is a chemical naturally produced in the body. In the brain, dopamine functions as a neurotransmitter which provides feelings of euphoria and well being. Endorphins are naturally occurring opioids that activate the dopamine pathway.
All addictive substances activate the dopamine pathway. A person takes a drug of abuse, be it marijuana or cocaine or even alcohol, activating the same brain circuits as do behaviors linked to survival, such as eating, bonding and sex. The drug causes a surge in levels of dopamine, which results in feelings of pleasure.
The brain remembers this pleasure and wants it repeated. If the brain senses that too much dopamine is being released it will adapt and inhibit dopamine release in an effort to normalize brain function. Once dopamine release is inhibited the external addictive substance is now required to maintain normal levels of dopamine.