Solar panels are pretty expensive to maintain, and not always safe. The photovoltaic cells used in generating solar energy use a substance called chloride. This substance is expensive to buy in bulk, and has many associated costs for handling and manufacturing. Cadmium chloride is necessary, though, as it helps to boost the overall efficiency of certain solar cells. However, scientists have found that magnesium chloride can provide the same efficiency but at a much lower cost, as well as without the safety and environmental concerns.
Magnesium chloride is safe to consume and can be disposed of without any environmental ramifications. Mg-Cl can be purchased for about $1 per kilogram, which is a small fraction compared to $300 per kilogram for cadmium chloride. These reduced costs can help to bring solar panels to the mass market.
Plus, Mg-Cl is basically just sea salt. So, scientists are able to apply it with a hobby sprayer on a desk, while the cadmium salt has to be applied with specialized equipment under a fume hood.