Gallons is a liquid measurement.
Dry good such as bio balls should not be measured in gallons.
It is a sales ploy:
to sell you less volume of dry goods;
while they make it sound like more.
1 US Gallon (liquid) = 231 cubic inches
1 US Gallon (solid) = 268.8 cubic inches
1 UK Gallon = 277.4 cubic inches
1 Cubic foot = 1,728 cubic inches
Take this with a grain of salt.
They say a good rule is 1 gallon of bio balls.
Will service 40 to 45 gallons of aquaruin water.
I have never had a problem with 5 gallons of bioballs.
Servicing a 100 gallon aquarium wet/dry trickle type biofilter.
But, that is just me.