How do CPU transistors switch between on and off?
I don’t know about the actual transistors INSIDE a CPU, but I can’t imagine they would be all that different from discrete transistors, which are are turned “on” or “off” (they actually have more than 2 states) by a small voltage signal applied to the “gate” terminal (on MOSFETs), or a small current signal applied to the “base” terminal (on BJTs).