Generally speaking here is how these things work:
I think it is basically a motion sensor, possibly infrared but it could be optical light. Sensors like this have an infrared or optical light sensitive transistor, the base or gate of which is turned "on" by the presence of infrared or light. The source element is an diode emitting infrared or light waves. When an object interrupts the infrared or light beam the "steady state" amplitude of the input signal changes and the transistor base-emitter or source-drain current varies in an analog fashion to the level of amplitude change at the input. This signal is likely amplified by am op-amp and when a threshold is reached a logic circuit will output high when certain conditions are met. This will actuate the sensor output...in this case a door chime or in other cases a switch closure, light bulb, or alarm circuit.