How this close loop control systems work?
The electric eye, in this case, is a PIR sensor (Passive infrared sensor). These type of sensors detect the movement of objects that emit IR radiation. IR radiation is also called heat radiation, and every human emits heat. That's why the "electric eye" in your case detects a thief. The thief does not have any external IR source, he is the actual IR source himself!

You can check a Wiki page for PIRs for more info. Also, there are great videos on YT for a better explanation if you need it:
https://en.wikipedia.org/wiki/Passive_infrared_sensor