This is known as the encoding specificity effect. In short, the theory is that memory and certain recalls of information is stronger for an individual if the conditions when the information is created in the brain are the same conditions that exist when the information is retrieved by the brain.