Electrons can absorb light, which gives them more energy, and allows the to move away from the positive atom that they, as a negative particle, are attracted to.
We use materials that have electrons that can absorb specifically the visible light spectrum, as that is the portion of light that we receive the most of.
When an electron absorbs a photon (a packet of energy, AKA light) it gains the energy from it, and can move away from its atom. We use some clever engineering to create a one-way system for electrons – they can move across a boundary in one direction, but cannot move back again.
So, you have an electron that has lots of energy, that it wants to lose because thats what particles do, which cannot return to where it came from. Unless it travels out of the panel, down a wire, through whatever electrical device we have connected to it, back down the wire, and finally back to where it started, but this time on the other side of the junction it started on. Here it can rejoin the material, and wait to be re-excited by another photon!
One of the fundamental rules of physics is that energy is neither created nor destroyed, but changed from one form to another. And thats exactly what is happening here!