Our Sun is by far the biggest source of energy on our planet. If world were to use just the tiny fraction of available sunlight we would satisfy our entire energy needs with solar energy because Earth receives each minute as much of energy from the Sun as a total human population uses in whole year. The problem is that our current technological level is adequate just to harness tiny (almost negligible) percentage of this enormous amount of energy.
Photovoltaic panels are used to convert sunlight into electricity. Photovoltaic panels consist of many solar cells. These solar cells are in most cases made of expensive material silicon, which explains why photovoltaic panels are still connected with relatively high costs, even despite the recent drop in prices.
Each individual solar cell is designed with a positive and negative layer in order to create an electric field (similar to the electric field in batteries). As photons (tiny energy packets of which sunlight is made) are absorbed in the cell their burst of energy causes electrons to get free, and they move to the bottom of the cell, and exit through the connecting wire which creates electricity (electricity is simply speaking a flow of electrons). The greater intensity of the light causes the greater flow of electrons, and the bigger electrical output.
By combining many of these individual solar cells into photovoltaic panels we can produce enough energy to power our homes or for any other purpose (solar cells have long history of use in supplying power space satellites).
The electricity generated by photovoltaic panels is direct current which means that we also need an inverter with which this direct current is turned into alternating current so it's in sync with mains electricity, and can be used normally.
It is also important to know that the amount of energy coming from the Sun varies depending on your location. What this means is that with current solar technology costs, installing photovoltaic panels isn't economically viable in all parts of the world, and is most preferable in areas that get plenty of sunshine throughout the entire year.
Science is working hard to create cheaper and more efficient photovoltaic panels (the "average" solar panel today achieves efficiency of no more than 18%, meaning that a lot of available solar energy gets wasted in the process). The future of this technology, however, looks to be very bright, with many new interesting solutions that tend to dramatically improve the efficiency of solar panels, and turn solar energy into the most dominant energy source in the world.