The led don't know the voltage but you no that the led is say 2 volt that's set the led is 2 volt
so it's 20 volt - 2 volts for the led for a max of 20mA so you need 900 ohms a 1000 would add a little safety.
Most don't take the led drop into account.
You could use a big resistor on higher voltage not really a good ideal but it does work just uses power.