Every computer you use is built on one primitive: the transistor. Understanding the layers that turn it into a CPU is the whole story of modern computing.
A MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) is a switch controlled by voltage. Apply voltage to the gate, and current flows between source and drain. Remove it, current stops. That's it. That's the fundamental unit.
Combine 2-4 transistors and you get a logic gate: AND, OR, NOT, NAND, NOR, XOR. A NAND gate is 4 transistors. Everything a computer does can be built from NAND gates alone.
Wire gates together to build:
Wire circuits together to build:
Connect the functional blocks with wires (buses) so data flows through them in the right sequence. Add a control unit that generates the signals to coordinate everything. Now you have a CPU that can execute one instruction: fetch, decode, execute, write back.
A "textbook" CPU processes one instruction at a time. Real CPUs use:
Put several full CPUs on one die, share caches between them, add a memory controller, PCIe interface, and now you have a modern chip. An Apple M3 Max has ~92 billion transistors, all built from this exact stack.
The OS treats the CPU as a machine that executes instructions and manages memory. Applications treat the OS as a machine that provides services. Every layer of abstraction hides the one below — but under all of it, transistors switching.