question about 'map' function

I just had a question question about using the map() function. In one of the example codes, map() is used to map sensorValue from 0-1023 to 0-255:

outputValue = map(sensorValue, 0, 1023, 0, 255)

My question is what voltage range does the 0 to 1023 correspond to? Since the arduino has a 5V power supply, does that mean that the range 0-5V corresponds to 0-1023? So if for example the sensoValue was 3 V it would be 614 and then mapped to 153?

Thanks for the help! First time using Arduino/working with coding...

does that mean that the range 0-5V corresponds to 0-1023?

Yes
The maximum value of 1023 is given out when the input voltage reaches the referance voltage, by default this is the same value that powers the arduino although you can set it to use other voltages.

Exactly...there are ways to set it for other voltages, but also notice the chip has a VREF pin?

You can place another reference voltage on that pin (up to 5 volts) and it will use that....this is especially important if you are trying to drive accuracy through your application...

Using analogReference (EXTERNAL) will allow you to use this pin...values are INTERNAL1V1, INTERNAL2V56 and DEFAULT.

Manual cautions that you must do this BEFORE you attempt any analog reads, or you risk shorting the internal reference, possibly damaging the board....