Until recently, when a solar panel reached the end of its useful life—after 25 or 30 years—it probably ended up in a landfill. Any valuable materials inside it were lost. But that’s quickly changing.