The LED projects an infra-red beam onto a phototransistor.
The double-pole switch and two resistors to ground (sort of) simulate the phototransistor.
When the beam is unimpeded, the photogate is ON (switched to 100R), when the beam is blocked, the photogate is OFF (switched to 100K)