Power from the National Grid keeps the light relay energized. The Circuit then follows on to the light circuit keeping the bulbs illuminated. The moment the grid goes off line the relay switches off, switching over to the solar source, ie inverter. That way the change over is automatic.