First is: battery density per unit of weight of battery.
According to chart in https://forum.cosmoquest.org/showthread.php?166243-Energy-De..., battery density between 2008 and 2013/14 (i.e. in 5/6 years) more than doubled.
Price per kWH dropped 5x in the same period.
What that means is that for the same weight, we could put 2x more battery in the car and it would cost 2.5x less (5 / 2). That would double the range, all else being equal.
But mileage doesn't depend only on how big the battery is.
The smaller / lighter the car, the more mileage it gets from the same energy. That means Tesla 3 would get a better mileage than Tesla S or X if it used the same battery because Tesla 3 is a smaller car.
There's also aerodynamic efficiency of the car and how you drive it (e.g. accelerating quickly uses up more energy than accelerating slowly).