Glutamate is your primary excitatory neurotransmitter. In short, phasic bursts it drives learning and long-term potentiation. Held high and tonic, it turns excitotoxic, and that chronic excess is implicated in neurodegeneration, mood disorders, and synaptic dysfunction. Most compounds that lower glutamate lower all of it and dull memory in the process.
Memantine is the exception. It only occupies the NMDA channel while the channel is already open and overfiring, sits at moderate affinity, and comes off fast. So it clips the pathological, tonic excess and leaves the fast, phasic signals behind LTP and memory largely intact. Same receptor family as ketamine, but without the high-affinity channel-trapping that produces dissociation. That selectivity, quieting the noise without silencing the signal, is the entire reason the compound is worth running.