Opioid tolerance develops as a learned response to drug-associated cues and is thus a dynamic effect modulated by the interaction between drug and environment.