Figured I'd chime in with one common cause of overdosing on opioids, and another not so common one.
One of the most common ways people overdose is after a hiatus from opioids, whether it be a cold-turkey kick, rehab, or whatever. They relapse and use the same dose they were using before they quit (or maybe slightly lower but not low enough) and end up overdosing because their tolerance has dropped so significantly.
Another factor contributing to overdose is the setting. If a person injects daily in the same surroundings and then one day uses in an unfamiliar setting, tolerance can be reduced and overdose becomes a greater risk. Not common or likely, but it definitely happens.
~CTdopeLove