Paintings are varnished after they are completed to seal the paint and protect it as well as even out the gloss level. The vanish itself can yellow over time and grime just builds up on the surface. Since varnish is solvent based, it can be removed with a solvent thinner without affecting the paint underneath very much. It’s cleaned like this and then varnish is applied to seal it once again. All of this is part of the care of the painting and increases the value. It’s not cheap though, so you’re not doing it often. Keep in mind as well that most of these old paintings spent much of their time in smoky, dirty environments. Restored paintings today will take much longer to yellow and contaminate.