Photosynthesis is fairly inefficient, but efficient enough to power all life on earth.
Silicon is a very good conducter. Probably the best for electricity.
One of the primary reasons solar cells are made of silicon is that the bandgap energy of silicon happens to be nearly equal to the energy of visible light, which is the major portion of energy emitted by the sun. Therefore, silicon is the ideal substance to fabricate solar cells with.
Si is a neutral semiconductor, and, when combined with the other metals in the solar panel, it the panel polarizes, and releases electrons form one end, and accepts them back at the other. Like a water pump. Mg is not the major ingredient because it doesn't have the easily altered semiconductor properties Si does. To put it simply, Si is easier to work with.