Why is a voltage divider used when reading analog sensors?
Well, you've already mentioned the reason: getting the signal level down to the input range of your analog to digital converter.

If your ADC has an input range of 0 to 5V, but your sensor puts out a signal that ranges from 0 to 10V, then there's a large part of your signal that you can't measure.  Anything over 5V is digitized as 5V.  Anything in your signal that lies between 5V and 10V is lost.

Another thing about exceeding the input limits is that ADCs are sensitive devices (as are most digital circuits like microprocessors.)

If you put a signal into them with a voltage that is higher than the operating voltage of the chip, then you can damage it - it won't work right any more, and may not work at all.

This applies regardless of the operating voltage.

If my ADC operates on 3.3V, then a 5V signal would damage it.

So, really it is all about staying in the allowed input range for your ADC, and there's a couple of reasons why you need to respect that range.



The datasheet of the ADC will usually tell you what voltage range is allowed. 

Check the datasheet rather than just depending on an assumption made on the operating voltage.



There's also the lower side of things to consider.

Most ICs don't like it if the input goes below the ground level.  

You get the same problems here that you would on the high side - loss of information and possible damage to the chip.

You will often see circuits that not only scale the signal with a voltage divider (or an attenuating amplifier,) but also shift it up (or down) to make best use of the ADC input range.

Say you have a signal that ranges from -5V to +5V. 

That's a 10V difference.

Now assume your ADC can only handle 0 to 2.5V.

What you would do is scale the signal to be between -1.25V and 1.25V using a voltage divider, then add 1.25VDC to it.

Your signal now fits completely into the range of your ADC, and since you know what you did to the signal, you can calculate the correct measured voltage from the ADC sampled values.