The energy that powers the sun comes from proton fusion deep within the star's core. The extreme temperature and pressure rips atoms apart, allowing freed protons to combine first into isotopes of hydrogen and then into isotopes of helium. This process releases tremendous amounts of energy.
Conversion of solar energy into electricity generally happens in one of two ways. Photovoltaic panels are treated silicon wafers that create an electron flow when struck by light rays, and create electricity directly. Concentrated solar thermal systems focus the sun's heat to boil water, using the resulting steam to drive a turbine and generate electricity. Photovoltaic panels are common in private household solar installations, while most industrial or commercial solar plants use concentrated solar thermal energy. Some even use a medium, such as molten salt, to store heat, allowing power generation even after the sun goes down.
Technically speaking, even fossil fuels trace their energy back to the sun. Fossil fuels are the result of the breakdown of plant and animal matter from millions of years ago. The plant life depended on the sun directly to generate food through photosynthesis. The same plants also served as the base of the food chain that nourished all the other organisms on the planet.