The media often uses the words "opioid" and "opiate" interchangeably. However, there are subtle but important differences between them.
The term opioid refers to any drug that acts on opioid receptors in the brain1, resulting in a wide range of pharmacological effects, especially analgesia (stopping pain). Other common uses for these drugs are suppressing a cough and stopping diarrhea. The term opioid encompasses all drugs -- synthetic, semi-synthetic, or naturally occurring -- which act on opioid receptors.
Opiates are a subset of opioids that are either derived from poppy or synthesized from any drug that is found in poppy or synthesized from one. It does not matter if the drug is synthetic or naturally occurring.
Opiates are a subset of opioids.
It is unnecessary to have both terms. For years "opiate" was used for either type of drug, and the introduction of the newer word opioid has served only to confuse. This is because it makes no difference where a particular drug comes from—plant or chemistry lab—the brain cannot tell one from the other. Worse still, while opioids encompass both naturally occurring and synthetic drugs, so do opiates. For example, heroin is not found in nature. It is synthesized from morphine. Yet it technically belongs in the opiate class simply because its synthetic precursor happened to come from poppy. Scientifically, this is nonsensical.
This ambiguity becomes evident from looking at the chemical structures of four drugs. Morphine is an opiate, which is one of the drugs isolated from poppy. Heroin, which is almost identical in structure to morphine, and is synthesized from it is also an opiate and an opioid. Fentanyl, which bears no resemblance to either, is synthetic, so it is classified as an opioid. But tramadol, which does bear some structural similarity to morphine, is only an opioid because it is synthetic and did not come from the plant. To a chemist, this kind of parsing is silly. The word opioid could be removed from the English language and it would not make one bit of difference scientifically.
*Note: There are three broad classes of opioid receptors called delta, kappa, and mu.