>>516090607
Because light guns are cameras.

So basically, pulling the trigger causes the screen to flash and if you're pointed at a target when it does your controller will see the flash and register a hit. However, this got a lot harder to do outside an arcade cabinet and when you add in how weak early LEDs were it's not surprising that light gun games went extinct. You could probably bring them back with modern LEDs but there's no market for that anymore.