This image (source) ought to tell you all you need to know about how it works. There are wiper contacts on the dial, shown at the bottom, that mate with pads on the meter's PCB.
These pads are connected to different taps of a voltage divider to divide the voltage, or to pass current through a current shunt.
Internally, the meter can only measure voltages from, say, -0.2V to +0.2V. The range switch changes the voltage divider to prescale the input voltage to be within that range, and on most meters will also send a signal to the LCD to tell it where to put the decimal point.
As for why you have to do it yourself instead of the meter doing it for you: Nothing more and nothing less than price. A meter that auto-ranges is more expensive than one that doesn't due to the need for additional hardware to detect when it's over-range and perform the switching.