@freemo the difference is from technological advances in metallurgy and the change from black powder to modern smokeless powders
Modern ammunition designs just don't need anywhere near the same amount of case capacity to generate the same amount (or more) energy.
The .38 vs 9mm is a good example as they have roughly the same diameter bullet but the 9mm has almost ~30% more energy despite being ~30% shorter overall.
@SteelFolk @drewfer
There is probably all sorts of crazy mettalurgy at play in the bullets of big guns.
Then there are barrels too. Today the barrel of a gun is much stronger and as such our bullets can produce much higher pressures.