I won't be able to explain as well as actual scientists, but when you experience something new, it creates new connections in your brain. We all have about 100 billion neurons, but the number of connections per neuron (synapses) more than doubles from birth to adulthood. Recalling a memory is done by the brain re-experiencing a past event by recreating the connections between specific synapses.
Here's a couple of blurbs from sites I found. There are good books out there, but not many good sites.
Your Brain is Not a Computer
It may seem redundant to say this, but your brain is not a computer. It never has been and it never will be. Your consciousness won’t be downloaded into a computer in your or my lifetime.
Computers are technology-based tools that only do what they are told (programmed) to do. Your brain, on the other hand, began life with a set of reflexes it was never taught. Your brain re-experiences things in order to for you to remember, but it doesn’t store those memories in anything that looks or acts like a computer’s storage device.
In short, your brain is not a computer. It’s time to put this misconception to bed.
https://psychcentral.com/blog/your-brain-is-not-a-computer#2
Memory: It’s All About Connections
When we learn something—even as simple as someone’s name—we form connections between neurons in the brain. These synapses create new circuits between nerve cells, essentially remapping the brain. The sheer number of possible connections gives the brain unfathomable flexibility—each of the brain’s 100 billion nerve cells can have 10,000 connections to other nerve cells.
Those synapses get stronger or weaker depending on how often we’re exposed to an event. The more we’re exposed to an activity (like a golfer practicing a swing thousands of times) the stronger the connections. The less exposure, however, the weaker the connection, which is why it’s so hard to remember things like people’s names after the first introduction.
“What we’ve been trying to figure out is how does this occur, and how do you strengthen synapses at a molecular level?” Huganir says.
https://www.hopkinsmedicine.org/hea...ctions,cells, essentially remapping the brain.