how can a little led indicator work in a power cord - why doesn't it explode from 240v
A lot of those cords use neon lamps, not LEDs. Many neon lamps are designed to be powered by line voltage with minimal additional components -- a resistor is often sufficient.