How can a powersupply have a large input volt range
It is done by magic ;-) Just kidding, it is not. It may look like a big deal but it's not actually. See the other answers, they are also correct.

The power from the mains is actually converted into MAGnetIC energy (do you see what I did there ;-) )and then back to electrical energy. Using very fast switches at the high voltage side the amount of energy that is transferred to the low voltage side can be precisely controlled. This conversion to magnetic energy also has the advantage that the output can be isolated from the mains supply so that you do NOT get an electrical shock when touching the output, I consider this is a very nice feature !

A reference voltage is made internally in the power supply's chip(s). Generating such a stable reference voltage is done using a bandgap circuit. The output voltage is compared to this reference voltage and adjusted so that it will be the correct voltage, this is called feedback. This feedback controls the circuit on the mains (high) voltage side and tells it to put more or less magnetic energy in the high frequency transformer depending on what the output voltage is doing. If the output voltage is too low: more ! If it is too high: less ! Simple as that. This feedback signal usually travels through an optocoupler (so using light) so that it does not need a direct wired connection to the mains side electronics and so keeping the isolation from the mains voltage side.

Due to this feedback the input voltage can vary over a wide range while the output voltage remains constant. Brilliant isn't it ? ;-)