I once heard this put in laymen’s terms as the following: An event or thought comes into your perception and hits a switch. The conscious thought goes past the switch into short term memory and then finally into long term memory. But sometimes the switch sends the thought into long term memory a split second before going to short term memory. When the thought leaves short term memory and goes to long term memory it gives the person the feeling that they’ve “been there before”.
I’ve also seen it related to precognitive dreams. Personally I was seeing a couple of episodes a week when I was in 5th-8th grade. I started writing the dreams down to make sure I wasn’t just confused or just doing something similar. They were always everyday things - nothing big.
The strongest after I started writing them down, was walking into 6th grade and talking with 3 of my friends before class - we always sat on the heater in the classroom and chatted for that last few minutes. Got back to my desk and pulled out my notebook - everything we’d just said was verbatim. I didn’t freak out about it, just kinda said - well at least I’m not crazy crazy. Still get it once in a while, but not nearly as much anymore.