Primary Memory
Main memory, which is RAM, is needed because it can hand instructions and data to the CPU quickly enough to keep it busy.
Secondary storage is built to keep files safe for years, and it is much slower to reach than RAM. RAM is built from electronics that respond in a fraction of the time secondary storage needs, so a program's instructions and the data it is working on are held in RAM while the program runs.
The CPU fetches instructions one after another and carries each one out in a tiny slice of time. If it had to collect every instruction straight from secondary storage, it would finish each one long before the next arrived and be left waiting for work. That waiting time is wasted processing power: a very fast processor gives you no benefit if it is starved of instructions. Main memory is the fast stopping-off point that keeps the CPU supplied, so the processor spends its time computing instead of waiting.
Picture a game where a skateboarder rolls along a street. Sixty times every second the program calculates the new position, checks whether the skateboarder has hit a bin, and draws the next frame. Each of those jobs needs instructions and numbers, and all of them have to be sitting in RAM. If they had to come from a hard disk each time, the skateboarder would lurch along in slow, uneven jumps, no matter how powerful the processor was. With the instructions and data already in main memory, every frame is ready in time and the movement looks smooth.
Edexcel GCSE Computer Science · Primary Memory