The 9mm parabellum is designed for higher pressure than 38 special, and typically uses a lighter bullet (124 v 158 grain), which combine to provide higher velocity. Since energy is proportional to the square of velocity, the 9mm also delivers about twice the muzzle energy.
The relationship between pressure and case capacity, powder volume and performance is complicated. The same load in a smaller case usually results in higher pressure. A larger load in the same case usually results in higher pressure (but not always). Faster burning powders result in higher peak pressure, but often lower velocity than larger volumes of slower powder. If you load black powder into a musket and push the ball halfway down the barrel, rather than snugly on top of the powder, you get a 36" pipe bomb.
In a nutshell, that's why we have SAAMI standards, pressure gauges and, more important, loading tables.