If you have read the article How Christmas Lights Work, then you understand why the strands are so sensitive to bulb failure. If any of the bulbs in the strand is loose, the entire strand will not light -- read the article to learn why.
In the case of household power, the current is alternating at 50 (European standard) or 60 (U.S. standard) oscillations per second. These oscillations set up a field near the wire that is fairly strong. The bulb tester picks up this field, and a simple amplifier amplifies it. The amplified signal is either strong enough to light the LED in the tester or it is not. The level of amplification is set so that only a strong electromagnetic field very near a wire will light the LED. All other sources of electromagnetic radiation are not strong enough to light the LED.
These testers are handy for other things, too. For example, you can point the tester at any wall outlet and it will tell you whether the outlet has power or not. It has a range or 3 or 4 inches (about 8 cm), so you can sometimes use the tester to find where wires are running through the walls as well.