When solar panels reach the end of their life, they are typically recycled. Recyclers will remove the panel frame and its junction box to recover aluminum and copper. The rest of the module is then shredded, including the glass, polymers, and silicon cells. These cells are coated with a silver electrode and soldered with tin and lead.
Recycling solar panels is much more preferable than releasing them into the environment. It's estimated that several million tons of solid waste is produced each year from solar panel recycling, compared to several hundred billion tons of CO2 gas.