Not to get all Brainy, but .
It's just like memorizing something . You say the word over and over with the definition and spelling. What you are doing is sending the electrical impulse across the same synapses in your brain over and over again.
Then effectively what you get is brain "burn-in" like an old projection TV.
It's the same with video-games. You're "memorizing the game " by playing it over and over. Then you get brain burn-in and your brain keeps sending the same impulses across the synapses even after you're asleep.
Also the eye is involved also. You are "burning in " the image in your retina also. That is why you still see the images when you close your eyes.
Well it's more involved than my simple explanation , but that gives you an idea.