This change can be detected by a discrete hardware or by a microcontroller. When light emitted by the IR LED is blocked because of the alternating slots of the encoder disc (also known as index disc), conduction level of the photo transistor/diode changes.
Common applications of position encoders are: Now a days, optical position encoders/rotary encoders are widely used even in hobby robotics.