In the restoration of a tooth, cavity varnish reduces

amalgam corrosion.

ion migration from amalgam to tooth.

transfer of thermal changes.

galvanic stimulation of the pulp.