@Neil, here is a simple version. When the light is switched on current is actually flowing through the (single) live coming in and out of the switch. This induces an electromagnetic field, which in turn can be used to induce a current in the device. The device stores this energy in a small built-in rechargeable battery and uses it.