That's part of it.
The largest part of the change in pressure is the valve timing. Specifically when the intake valve closes, compression begins. When the valve closes later, with a long duration cam, the piston is farther up the bore. Less volume being compressed = less pressure read at the gauge. When it closes earlier, with a short duration cam, there's a larger volume being compressed so you have more pressure read at the gauge.
That's why you see minimum compression ratio specs listed with big cams. Not enough compression and it'll be a dog with a big cam because of low cylinder pressure. Too much compression and a small cam will be a detonation monster because of too much cylinder pressure.
There's a small relationship to engine size as well. Larger engines have a larger volume of air so a longer duration cam will work with less compression, to a small degree.
It's all about choosing parts that work together.