Goggles fog up due to a number of factors, including the temperature difference between your body and the water, the humidity rate, etc.
Wear due to rubbing is one of the main causes.
If your goggles fog up, dip them in water and a protective film will once again form on the surface. Over time, the anti-fog treatment will lose its efficacy. Anti-fog coating reactivation agents are available for purchase.