Solar panels are usually made up of complex forms of silicon which can trap sunlight during the day time and then convert it into electricity. The source of producing electricity is sunlight and these panels are essentially used to entrap maximum amount of solar radiation. Photon is one of the main elements present in the sunlight and it contains energy.
As the photons strike the silicon surface the electrons are released continuously and thus electric energy is produced which can be stored or used instantly to run the electronic devices. You can also use solar thermal collectors to entrap the sunlight and produce heat and electric energy. The solar panels produce electricity from a natural source and are efficient enough for your usage. There are online sites where you can get video clips that will show you how the solar panels will work. The sun is the major source for functioning of solar panels.