how does the servo library run code during normal operation

So, I know that the servo library works by sending a pwm signal to the servo motor every 20 ms, and the pulse width determines the angle of rotation, but after you call the position of the servo, it keeps writing that signal every 20 ms without blocking the code that is running in the "void loop()" i tried to look at the .cpp file for that library but i dont understand all of the "#define, #endif, static, volitile etc." stuff.
So how can the arduino run the normal code in the void loop and the code for the servo motor at the same time???

Timer interrupts.

This might help -

Duane B

rcarduino.blogspot.com