Even though RAM is fast, it isn’t fast enough to keep up with the CPU.
SRAM stands for static random access memory. SRAM can retains its data without constant electrical power. SRAM is faster than regular RAM. SRAM is very expensive. A few megabytes of SRAM are place in the CPU.
SRAM acts as caches inside of the CPU. The SRAM cache preloads instructions in case the CPU needs to access them. This reduces wait states where the CPU is just waiting to receive information from RAM.
When the CPU looks for a line of code, it first looks to the cache. There are different levels of cache. L1 cache is usually on the CPU and is the first one the CPU tries to use. L1 is generally very small and runs at the multiplied speed of the CPU. The L2 cache feeds the L1 cache. The L2 cache is bigger than the L1 cache, and is the second place the CPU looks for information. The L2 cache runs at about half the speed of the L1 cache. Modern CPUs also contain an L3 cache. The L3 cache is the biggest (megabytes). The L3 cache runs at about the base speed of the motherboard, which is still faster than the normal RAM.