Let's make it a bit simpler:
Take a 1lb chunk of lead.
Take 1/12th of it, roll it into a ball, and that's a 12 gauge.
Take 1/20th of it, roll it into a ball, and that's a 20 gauge.
And so on.
Filling up a shotgun barrel with balls of lead is nothing to do with it, neither is the length of the barrel...
10g 0.78" (19.7 mm)
12g 0.73" (18.5 mm)
16g 0.66" (16.8 mm)
20g 0.62" (15.6 mm)
28g 0.55" (14.0 mm)