I am Charles Darwin, I have a theory that species survive through a process called natural selection. This means that those that adapt and evolve end up reproducing and thriving, and those that aren't able to adapt die off. This leads to the survival and reproduction of the strongest.
As humans we have many cognitive abilities such as memory, ability to learn new things, speech, and attention. We all have these abilities based on evolution. Humans with these abilities survived and reproduced and those who didn't died off.
Evolutionary psychology relies on my theory and it requires three elements: variation, inheritance, and selection.
Variation in traits is required within a species. If there was no variation amongst traits there would be nothing to select from for natural selection. So for an example, one's mind may not have been wired to memorize things. After natural selection human's brains are set up to be able to memorize.
Also one passes their genetic material to the next generation which is a process called inheritance.
Lastly, selection is a change in the environment that favors one trait over another. So, being able to memorize things was a selected trait.