How can CPUs be stable when they have so many transistors?
It's simple, we test them before we sell them and throw the bad ones out.

There are lots of ways to do this - different people do different thing, often use a combination of: 


some tests are at speed to make sure they go fast enough. 
other tests involve a mode that turns some or all of the flipflops in the chip into giant serial shift registers, we clock known data into those chains, then run the chip for one clock and then scan the new results back out and check that they match our predicted results - automatic test tools generate a minimum set of "scan vectors" that will test every random gate or transistor on the chip - other vectors do special tests of ram blocks,
others test that the external wires are all bonded correctly
we make sure it's not pulling an unhealthy amount of current


Testing time costs money, we sometimes do some simple testing for obvious dead chips before they are packaged to discard the bad ones and then more testing after the packaging is done