Solar panels convert sunlight into electrical energy, and have turned into a key contributor for making energy supplies more sustainable. But how do they actually work?