There are only a small number of registers (the "register set"), typically 32 in a modern processor though some, e.g. SPARC, have as many as 144. A register may be directly addressed with a few bits. In contrast, there are usually millions of words of main memory (RAM), requiring at least twenty bits to specify a memory location. Main memory locations are often specified indirectly, using an indirect addressing mode where the actual memory address is held in a register.
The limited size and high speed of the register set makes it one of the critical resources in most computer architectures. Register allocation, typically one phase of the back-end, controls the use of registers by a compiled program.