The reason why headlights with polycarbonate (a.k.a. plastic) lenses begin to look cloudy and faded is because the UV resistant coating on the lens has seen some wear and tear due to the constant abuse from road grime, bugs, rocks, dirt, snow, salt, etc.
When the UV resistant coating begins to pit, it will expose the bare polycarbonate lens. When that is done, the constant UV rays from the sun will oxidize the composition of the plastic and create the faded, cloudy lens.
To repair this problem, sanding the entire headlight is a must so that the failing UV coating that was applied when the headlight was made, is completely removed. You will then need to remove the scratches and the haze from the lens by polishing and restoring it to new condition.
At that point, the headlight will look crystal clear and will be able to allow light through the lens instead of being distorted from the haze. If it is left like that, it will begin to haze again in a matter of no time, especially if you live in an environment where your car will see alot of sun. The best way to prevent the oxidation is from a Paint Protection Film. Since it is a UV resistant film, the sun’s UV rays won’t be able to deteriorate the lens.