The code is compiled to binary. The binary values either turn switches on or off. So all that is happening is that the series of instructions turning switches on and off. Each instruction is doing something very simple but if you have lots of them it can do something complex.
A typical PC is nowadays 3.4GHz, that is 3,400,000,000 switches per second. It is that very high rate of switching which makes computer seem intelligent. You can even get multicore computers quite cheaply so multiply the above number of switches. e.g. a Quad Core PC will do 14,000,000,000 switches per second.