The Science of Heroin
There are three important brain chemicals--neurotransmitters--that relate to heroin: dopamine, norepinephrin, and the endorphins.
Dopamine helps to control human appetites for both food and sex. Large amounts of this substance are also associated with being out-going and exuberant. Parkinson's Disease and depression are related to having too little dopamine in the brain whereas schizophrenia is related to having too much. Heroin, like pretty much all drugs that get a person high, causes a release of dopamine.
Norepinephrin governs the sympathetic nervous system--the nerves of the body that cannot be voluntarily controlled. It's primary purpose is to stabilize blood pressure so that it does not get too low. When a provocative situation arises, the brain's release of this substance stimulates the fight or flight response. Heroin depresses the middle brain--the locus coeruleus, in particular--and so provides the user with the opposite feelings: safety and contentment.
There are sites in the body--primarily in the brain and spinal cord--called opioid receptors which are involved in happiness and feelings of safety. These sites were originally discovered by scientists searching for mechanisms that allowed morphine to cause pleasure and relieve pain. All of the opioids attach to these sites where their effects are felt. There are at least five different kinds of opioid receptors but only four that are closely associated with the effects of the opioids: mu, kappa, delta, and sigma. The mu and kappa sites affect pain relief, the delta sites are involved with feelings of euphoria, and the sigma sites relieve depression.
It makes sense that the body would not have these receptors unless it created its own chemicals which would fit into these sites and before long, scientists had discovered endorphins--morphine-like chemicals used by the body for many purposes but primarily to modulate mood, promote pleasure, and manage reactions to stress.
The way that morphine differs from the natural endorphins--and there is some indication that the body creates its own morphine, not just morphine-like substances--is that it is possible to bombard the receptors with it whereas under most circumstances, the body only produces a small amount of endorphins at any time.