The Hippocampus is a small organ that forms an important part of the limbic system (a region of the brain that regulates emotions). Its main function has to do with the consolidation of information moving it from short-term to long-term memory. In other words, it plays an essential role in the formation of new memories about past experiences.
What the hippocampus does very well is with how it attaches memories to emotion and associates them to the accompanying sensory experiences. This is essentially where deja vu moments arise.
For instance, a pleasant emotional childhood experience of joy and laughter can become associated with the smell of a freshly baked cake. This of course stems back from a moment during your childhood where you were filled with joy and happiness. At the time your mum took out a freshly baked cake out of the oven. As a result the Hippocampus associated those pleasant emotions with the smell of the freshly baked cake. That memory was of course years ago, but whenever you smell that freshly baked cake today, you immediately experience a flood of positive emotions that bring you joy and happiness — just as you felt when you were a child. That’s kind of what a deja vu is all about.
The hippocampus takes those memories and the accompanying emotional experiences and stores them away within the cerebral cortex. Here the memory enters long-term storage where it can be retrieved at a later time when your mum bakes another cake. 🙂