If you’re replaying then in your head, You’re building new memories and storing it. Then you’re referencing that memory, which in turns build a new memory of that memory.
Look into how memory and recall work, which can help with understanding this process!