>They probably can get the right estimate for a destination because it knows the speed limit
Even this is a massive over-simplification. Driving the same speed with a 20 mph headwind is going to take lot more energy than with a 20 mph tailwind for example. There's lots of other variables and they may be certainly tracking some (like A/C current draw) but I doubt they track others (like rolling friction or road conditions).
Edit: I found this article [1] and it claims they track an impressive amount of weather and traffic data for the calculation. I'd be curious if this is based on car sensors (probably not?) or local weather stations.
[1] https://electrek.co/2022/03/16/tesla-accounts-wind-air-densi...