The general way to describe driving range is:
range = energy stored / energy consumed per mile
Battery pack size, or for that matter gasoline tank size, is the primary determiner of driving range. It's a simple equation: Divide the energy stored on the vehicle by the energy consumption per mile, and you have the driving range. (See Energy storage, energy consumption, weather and electric car driving range)
Here's two concrete ways to correlate energy storage, energy consumption, and range.
range = gallons gasoline / gallons consumed per mile range = kiloWatt-hours / kWh consumed per mile
These are of course rule-of-thumb calculations. Someone driving aggresively with a lead foot will consume more energy per mile, and therefore get less range. It does not matter whether you're driving a gasoline or electric vehicle, physics is what dictates that result.
Put another way -- an electric car will often support driving 4 miles per kiloWatt-hour. Therefore a 24 kiloWatt-hour car might give 100 miles of range. But, the Nissan Leaf when it had a 24 kiloWatt-hour pack was only rated for 75 miles of range. What gives?
The manufacturers design electric vehicles to prevent consuming the last electron in the pack. Bringing a battery pack to have no remaining electricity will damage the pack. Therefore electric cars are designed to hold some energy in reserve.
To avoid the risk of battery damage, some electric vehicles are designed to start warning the driver when the charge is running low. The Kia Soul EV starts bugging the driver at 20 miles remaining range to find a charging station soon.
Secondly, the official range estimate is calculated by using an EPA testing protocol. The calculation earlier is way too simplistic to do anything more than get you in the right ballpark. The EPA test is a much better estimate of likely driving range. It is based on a variety of speeds simulating a combination of city driving and highway driving. (See How does EPA estimate electric car driving range?)