Solar energy works by trapping sunlight in solar panels and converting it into electricity. Solar panels are made up of a series of cells that contain semiconductors, such as silicon. When sunlight hits the cell, it causes an electric field to be created. The electricity generated can then be used to power homes and businesses.