How servo works?

A servo is basically a regular DC motor, with the output shaft feeding into a potentiometer, which is in turn connected to some control circuitry. The control circuitry compares the output of the pot with a control signal, and makes the motor move so that the output of the pot will match the control signal.