The only thing I know is that multiplying the dashboard mpk numbers by 21 kWh (or 17 kWh for an 80% charge) results in range numbers that match my experience. For instance, freeway driving at 60 mph, I can reliably get 4.1 mpk or so. Multiplied by 21 kWh, that results in a range of 86 miles, which pretty closely matches my experience. Multiplying by 24 kWh gives me 98 miles, a number I know I can't reach driving at 60mph.
It's all handwaving and guessing...the real number could be more or less than 21...it could even be 24 and the mpk readout is off. The only thing I care about is being able to reliably predict range. Using 21 kWh does the trick.