The headlights on modern cars are made of a polycarbonate plastic rather than glass. This durable plastic protects the bulb and improves the car’s aerodynamics. However, this material is porous, so it must have a protective layer over it. As your car is exposed to the environment this protective layer wears away due to exposure to chemicals and sunlight, leaving the plastic layer unprotected and prone to oxidation. This, and physical damage such as dent and scratches, causes the fogginess that you see on some headlights.