AC vs DC on an Oscilloscope
In AC mode the oscilloscope displays the signal with average voltage of 0V. 

It does this by using a series capacitor and a resistor to ground. The RC time constant of the resistor and capacitor is long enough that most signals won't be distorted much and fast enough that you (as a human) don't have to wait 'too long' for the display to stabilize. Below diagrams from UofW lab notes. 





If you try to measure a signal such as a very low frequency square wave using AC coupling you'll see distortion (in that case, a slope towards zero after each zero crossing). 

The main purpose of AC coupling is to allow you to see something like a small ripple or signal on top of a large DC voltage. For example, if you have an amplifier biased at 4V out and there is a 800uV signal present at that point, you will not be able to see it on a 1V per division setting. In fact, the signal will not even be captured by the oscilloscope ADC. 

By using AC coupling, the scope can be set to 200uV per division and the signal can be displayed in all its glory. If you need to know the offset, you can switch the input to DC coupling and you'll see a flat line at 4V.