First, let's establish what 0 and 1023 means. 0 means 0 volts is detected on the analog pin. For a pot to give a value of 0, it would need to provide infinite resistance, or completely open the circuit. 1023, means the voltage on the pin is equal to analogReference(), which by default is the operating voltage for the microcontroller. For a pot to give a value of 1023, it would need to provide 0 resistance, or a short circuit on the pin. map() simply creates a ratio, so if 0-1023 is mapped to 0-100, it does not establish that only a value between 0 and 100 will be reported. If a value greater than 1023 or less than 0 is mapped, it will be above 100 or below 0, following the scale set.