Why does this rotary encoder have both PCB pins and mounting screw?

Don't forget the hole for the little metal tab on the front. That's to stop it from turning when the user twists the knob.