Encoding specificity principle
The encoding specificity principle is the general principle that matching the encoding contexts of information at recall assists in the retrieval of episodic memories. It provides a framework for understanding how the conditions present while encoding information relate to memory and recall of that information.
Source: Wikipedia — Encoding specificity principle (CC BY-SA 4.0)