Codeine or 3-methylmorphine is an alkaloid found naturally in opium. Codeine is a compound that is metabolized in the liver to produce morphine. Due to the slow metabolic processing rate, the therapeutic sedative effect is far less potent than morphine.
This substance decreases the activity of the central nervous system and has a powerful effect on pain. Rather than block or eliminate pain, opiates change the emotional reaction to it: the pain is felt yet, it has reduced emotional consequence and matters less. Something similar happens with hunger, fear and anxiety; so many opiate users experience this decrease in suffering as, happiness.