The X86 processor has three modes - Real Mode, Protected Mode, and Long Mode. Real Mode operates in 16 bits and only has access to 1MB of memory. The processor boots up in this mode and it is up to the BIOS/OS to change the mode. Protected Mode operates in 32 bits and is backwards-compatible with Real Mode. Protected Mode also provides protected memory, which prevents programs from accessing each other's memory ranges. Long Mode operates in 64 bits and is backwards-compatible with Protected Mode.
Backwards compatibility, on a register level, is achieved by sharing the register bits. For example, the AX register is a 16-bit register. The EAX is a 32-bit register that shares 16 bits with AX. Similarly, RAX is a 64-bit register that shares 32 bits with EAX.
|----------------------------------------------------------------|
|<---------------------------- RAX ----------------------------->|
| <------------ EAX ------------->|
| <----- AX ----->|
|................................................................|
|----------------------------------------------------------------|
Note that there's also an AL and AH which represent the high and low bytes of the AX register.
-- Giac Veltri (Senior Engine Programmer)