How can the Arduino Uno support up to 12 servos if it only has 6 digital PWM pins?
The Servo library doesn't use PWM. When you call write() it computes a pulse width in microseconds and stores it in a global array. Then there is a single timer that regularly triggers an interrupt which changes the output signals according to each channel's desired pulse width.

You can find the source code below :
Github link