It's a light gun. It has a single light sensor in the tip, which picks up light from the part of the screen it is aimed at. Given that the CRT TVs used at the time essentially instantaneously displayed the signal sent from the console, this was quite sufficient.
I've never used a Zapper myself, but according to the Wikipedia article, it worked as follows: when the trigger is pulled, the console would display a flash of light from the location of each target in sequence. Whichever flash produced a pulse from the sensor indicated a hit target.
Using even finer timing (which, again according to the Wikipedia article, the Zapper was not capable of), arbitrary locations on the screen can be identified by detecting the pulses resulting from the sweep of the electron beam across the screen.
All of this is fundamentally dependent on the low-persistence nature of CRTs: each location on the screen emits light only when the input signal passes them as it sweeps out the entire image. This is very different from modern LCD displays, where each individual pixel is a device which changes state (slowly!) between passing or blocking light from the backlight, and the timing of the display change is dependent on the internal digital processing in the display.