The only difference between the two is Opiates are a subcategory of Opioids, in that opiates are derived from NATURAL sources, white other opioids are from artificial sources.
Although the term opiate is often used as a synonym for opioid, the term opiate is properly limited to the natural alkaloids found in the resin of the Papaver somniferum (opium poppy), while opioid refers to synthetic substances.
https://en.wikipedia.org/wiki/Opioid
Thus Opioid is the name generally used for drugs that would be called Opiates, but technically NOT derived from the opium poppy. Opioids work on the same nerve endings as opiates.
As I said, most of my clients, who are on pain medication NOT reduced by other drugs, are on opiates (including Morphine). Please note these are RARE CASES, I do a lot of Social Security Work and get such a client about once every five to ten years (Most people on that level of Morphine get Social Security on the initial application). I do get them, but as I said, most are on Opiates not Opioids (With each defines as defined above, Opiates are derived from Opium poppy, Opodis are NOT).
One of the reason for the rarity is a lot of doctors do NOT want to be accused of drug dealing. Thus Doctors will refuse to prescribe opiates for the simple reason they fear being called a drug provider by the DEA. One of the attacks on the laws being passed to permit assisted suicide is that many of the people who are looking at suicide is do to the lack of access to opiates, and that if opiates were easier to get, that is a better solution then assisted suicide (It is better to be high and alive, then dead).
Just a comment that such drug use does occur, but only in the most severe cases of pain and then only after every other pain medication had failed to ease the pain.