Animals evolves two main forms of memory.
Short term memory, and long term memory.
Think of short term memory like RAM it is very volatile, and long term memory like a hard drive.
Your capacity for short term memory is entirely genetic, but the way it works in real life is that you take out data from your long term memory and put it into your short term memory very rapidly as you process new stimulus, and also put short term memory data into your long term memory depending on subconscious factors & conscious factors.
You can control what goes into your short term memory by focusing on that particular task. If you are just living life, you tend to absorb stimulating data and save it into your hard drive periodically, but if you need to save specific data, you need to hammer the data into your short term memory constantly, until a background process sweeps it into your long term memory, this is called "studying".