raja
Actually, no. Simply, or not.
The essence of it(Keep in mind this is simplified) is the following:
A CPU(not the OS) runs the following loop:
a - Fetch instruction at memory pointed to by `program counter`
b - Increment `program counter` to point at next instruction
c - Execute instruction(this may modify the `program counter` if it's a jump or branch)
d - GOTO a
The only way to break a CPU out of this endless loop is via interrupts. At the hardware level, an interrupt is a wire whose value is kept constant(say at 0V) when nothing is happening and switches to a logical 1(say, 5V) and back down again when an event happens. Some interrupts are wired to signal a keyboard press, or a network packet landing the the network card's buffer or a requested disk read being ready, etc, etc.
The CPU usually has a table it will consult that maps a given interrupt to a location in memory of its handler. So an interrupt breaks the infinite loop by modifying the `program counter` to point at the interrupt handler, so the next instruction that gets executed is the first instruction of the interrupt handler.
Now, back to the OS talk. When an OS wants to run a process, it will load that process into memory and point the program counter to the first instruction of that program. Essentially, this hands over execution over to the process and the OS, though still loaded in memory is no longer executing.
However, the OS makes use of a special interrupt, which is the timer interrupt to run multiple programs at once. Modern CPUs include a clock which can be configured to fire off interrupts at a constant rate(if you compile your own linux kernel, you can change the setting of this clock, I think the acceptable range is 10Hz => 1000Hz).
Every time this clock fires off an interrupt, control is taken away from the executing process and handed back to the OS. The OS can then choose to hand over control to another program(so you can have multiple processes running on a single CPU) or return control to that same process, or perform tasks of its own.
TL;DR
No, the OS is not a loop, the CPU runs a loop, the OS does not. you will not find, no matter how far back you trace the code, a "While True: <run programs>" at the root of any OS's code :)