It's attached to the headstock spindle and then when spinning passes between a black plastic piece on the back of the display... and thus calculates the RPM's
Would that be a tachometer?
I think the bit you are talking about is a rotary vane that passes through the sensor - which is either optical (beam of light) or magnetic (inductive sensor)
The pickup (optical, or a magnetic proximity sensor) produces pulses as the rotor passes it. The pulses are counted by the electronics and a number is output to a (usually) digital display. Dominik's post shows this