It works by having a voltage-controlled oscillator (VCO) inside, and driving the VCO with a voltage signal that depends on the frequency difference between the internal VCO and the external signal.