Dew forms on a surface when the temperature of that surface falls below the dew point. A surface exposed to the clear night sky cools by radiating heat out into space which is only a few degrees K (This is an over simplification of course as the atmosphere blocks the radiation at some wavelengths but you get the idea). A dew shield works by limiting the angle over which the heat can be radiated away. Cooling still takes place but more slowly. There may be other effects. For example some people swear by rolled up newspaper or other absorbing material which perhaps preferentially absorbs the moisture in the air close to the optics.