Inside a Solar Yard Light
Here are close-ups of the LED and the controller board:
On the other side of this module is a four-cell solar array, measuring 2 inches by 2 inches (5 cm x 5 cm), and the photoresistor:
Here is a closer view of the photoresistor:
See How do the streetlights turn on automatically at night? for more information on how photoresistors work.
Now let's see how the whole setup works to light your yard at night.