The CPU controls the flow of data and instructions in a computer system. It has two main components - the control unit which directs the execution of instructions, and the ALU which performs arithmetic and logical operations. The CPU uses registers for temporary storage and RAM for main memory. It fetches instructions from memory one at a time and executes them, performing operations on data as directed.