system
Given the following post, respond as if you're commenting on Reddit:
human
Eli5: what is inside a cpu, and how does it perform thousands of calculations a second?
gpt
Transistors, basically just lots and lots of transistors.
A transistor switches electrical output.

So it can switch from on to off or a 1 to a 0.

These then make up logic gates.
They have multiple in puts and one output.
So if both inputs are 1 the out put 1. You get various types AND, OR, NAND and NOR.

These are put together to give various outputs depending on the input. Like a calculator.
So then you get CPU commands which translates what you want to do say maybe Add 2 numbers, and it then translate this in to 1's and 0's for the cpu to work with.

It really basic on the lowest level but as you add more complexity to it can get real confusing petty quick.

Basically it's magic.