Yeah, caffeine blocks the adenosine receptors in your brain. Adenosine is a chemical your body produces throughout the day to signal you getting tired. That’s why when you drink coffee, a few hours later you might feel a “crash”, because all of the tiredness comes rushing back into your brain at once
Like the article suggests, that blocking of adenosine receptors happening too late can mess with your sleep quality, because your body wants to sleep, but your brain can’t because it doesn’t feel tired. So you might end up getting poorer sleep. This could lead to poorer long term memory storage/encoding, because one of the functions of sleep is to take short term memories and store it in your long term memory.
I drink a lot of coffee, but I usually stop around 4 or 5pm because even though I normally sleep well, I've definitely experienced caffeine-induced insomnia.