The lens is polycarbonate with a UV-protective coating on the outside. Over years of sun that coating breaks down, the plastic underneath oxidizes, and the yellow haze you can see is the plastic itself degrading. That is why glass cleaner and a magic sponge do nothing.
A restoration takes the oxidized layer off with staged wet sanding, from coarser to finer, then polishes the lens back to clear and seals it. The surrounding paint and trim are masked first, because sanding residue on paint is a problem that can outlast the headlight job. You can watch every stage on our headlight restoration process page.
The sealing step is the one that decides how long the result lasts. Sanding alone leaves bare polycarbonate, which will yellow again quickly because you have just removed what was protecting it. The longer story is in why headlights go yellow.