Source on the right is a solar cell, capacitor is a battery. Serial resistor simulates internal resistance of the battery. When the solar cell is illuminated and charging the battery, the LED is turned off. At night, the solar cell switches off and the LED turns on drawing the current from the charged battery.