The CPU's primary role is to execute instructions and perform calculations, which is facilitated by its internal components: ALU, CU, and registers. Secondary memory stores data and programs but is external to the CPU.