[1] https://thelastpsychiatrist.com/2007/08/how_to_take_ritalin_...
There is such a thing as state-dependent memory or context-dependent memory: recall is better when the environmental context (e.g. location, lighting, smells) matches the context of learning.
If you study while on Adderall, which alters your neurochemical state (increasing dopamine and norepinephrine activity), you may recall that material more effectively when you are in the same neurochemical state, that is, also on Adderall.
Similarly, if someone learns something while sober, they will generally recall it better when sober again, rather than under the influence of a drug.
It is the phenomenon where memory recall is improved when the internal physiological or psychological state matches that during learning.