When you measure with a DC connection you are measuring the actual waveform voltage values to common.
When you measure with an AC connection you are placing a capacitor in series with the measurement which blocks the DC in the waveform. This means that the average voltage must equal zero. The voltage will thus shift to make the average zero. The amount of shift depends upon the waveform shape and duty cycle.
The AC measurement mode is typically used when you want to look at a small AC signal that is riding on a large DC component.
AC measurements use a capacitor inline with the signal, assuming the waveform is symmetric it will appear to average 0 volts. When you measure it via DC you'll see any DC signals as well so the whole thing will be lifted up (or down)