Solar panels are becoming cheaper

Solar panels are becoming cheaper and more efficient. So how exactly do they work?