To understand how photovoltaics work, you first need to understand a bit about solar energy. Basically, sunlight is loaded with photons. Think of these as little packages of solar energy. Photovoltaics are panels that turn this sun power into electricity. They are usually made from silicon and small amounts of boron.
When the photons from sunlight hit a silicon molecule, they knock loose one of its free-floating electrons. This electron hits another silicon molecule, shunting it's electron out of it's molecule. This starts a chain reaction, rather like one domino striking another, which knocks over another, and another....
The final result of this chain reaction is what is known as an flow of electrons, or an electrical current.