Opioids are substances that act on opioid receptors to produce morphine-like effects.  Opioid receptors are widespread in the brain, and are also in the spinal cord and digestive tract.

Opioids are chemical substances that relieve pain. There are a wide range of natural and artificial opioids. They are used in hospitals to treat acute pain, as can occur after an operation. They can also be used to relieve pain, where treatment no longer makes sense, for example in certain cancer patients. Drugs that can relieve pain are broadly known as analgesics.

Certain opioids are used as anesthetics, as well as in emergency medicine and intensive care. There are cases which are difficult to manage with non-opioid analgesics.

Certain opioids have been used as illegal drugs. They can cause impairment if taken in large amounts. Most opioids are controlled substances, only available by prescription.

The term Opiate is sometimes used as a synonym. Most often it is used to refer to opium alkaloids, and semi-synthetic opioids.

Natural opioids

Endogenous opioids 
So called endogenous opioids, also called endorphins, are peptides produced by the human body. They are used to respond to stress, to suppress pain and hunger. They also interact with sex hormones and they can cause a state of Euphoria. Mammals produce them in the brain.

Opium alkaloids / Opiates 
There are different alkaloids that naturally occur in opium. Opium is produced from Opium poppy. The most important ones are morphine, codeine and thebamine. Papaverine and noscarpine also occur in opium, but the way they work is different. Most of the time, they are therefore not counted as opiates.

Semi-synthetic opioids 
These are produced based on natural opioids, which are changed. Examples include heroin and oxycodone

Fully synthetic opioids 
Examples are 
pethidine
methadone

Addiction to opioids 
Drug tolerance to opioids and other narcotics can develop with long use.  This means that higher doses will be needed to keep the same effect.  It also means that the body will eventually learn to operate normally with that amount of medication.  When the user tries to stop taking these pain killers, withdrawal symptoms appear. Withdrawal from opioids is not life-threatening, but it can be uncomfortable, so it is important to get medical supervision. These symptoms include restlessness, pain in the bones and muscles, insomnia, diarrhoea, vomiting and involuntary leg movements. However, the psychological symptoms, including cravings, depression, anxiety, and insomnia, are more likely to lead a person to relapse if they are not working with a doctor to safely detox.

If the addiction keeps on going, eventual permanent brain changes can appear, which eventually adapts to the drug’s presence. Both prescription and recreational users of Opioids find that they will have to take increasingly larger doses of the drug to get the same effects, a process known as developing a tolerance. As users take greater and greater amounts of Opioids, they become progressively dependent on them. At this point, a full-blown addiction has developed. Even patients who experience chronic pain may be at risk for addiction, even though they are prescribed Opioids for treatment.

References 

 
Analgesics