The Ideal Gas Law as shown below, describes the relationship of pressure, temperature, and volume.
The state of an amount of gas is determined by its pressure, volume, and temperature. The modern form of the equation is:
pV = nRT
where p is the absolute pressure of the gas; V is the volume of the gas; n is the amount of substance of the gas, usually measured in moles; R is the gas constant (which is 8.314472 JK−1mol−1 in SI units[4]); and T is the absolute temperature.
http://en.wikipedia.org/wiki/Ideal_gas_law
If you solve for T, you have the following:
T = pV/nR
As the temperature goes up, so does the pressure, for a given volume. This describes the ignition stage of the powder. At the beginning of ignition, volume is a constant, and temperature goes from the atmospheric temperature to roughly 1400*C, according to their abstract (it will likely vary depending on a number of factors), which raises the pressure in the chamber. Once the pressure is greater than the frictional (drag) force holding the projectile in the barrel, the volume becomes variable as the projectile is...projected out the barrel.
Notice that volume and pressure have an inverse relationship - if you have a larger volume with the same amount of powder combusting, the pressures will be lower. This explains the differences in the use of various types of cannon. In a mortar, the bore is relatively large and the depth of the bore relatively small compared to a cannon with a smaller bore. Using the same size load, the initial volume will be the same, assuming the projectile is sufficiently seated on the powder, but as the projectile moves (which will occur at different pressures for different size projectiles, as the drag force is a function of mass), the volume increases more quickly in the large bore mortar than in the small bore cannon, relieving some of the pressure in the barrel (though more is being made by the still burning powder). Having a longer bore in a cannon allows the pressure to build up for a longer before the projectile exits the barrel, contributing to higher muzzle velocity. That paired with the size and wieght of the projectile can be used to determine range, and thus you have long range "small" bore guns and sgnificantly larger bore short range guns.
Of course having proper windage for a projectile is important as well, because as the pressure builds to the point that it can move the projectile, the explosion is still taking place, resulting in more material being involved in the reaction that produces the gas that propels the projectile. If the projectile were oversized and became lodged, the pressure would continue to rise until either the powder is fully incinerated, or until the volume of the explosion is increased. If the powder fully incinerates without the volume increasing, you'll have a pressure vessel. This is unlikely, because it would mean that you grossly underloaded the gun, and that the vent was plugged during ignition. A volume increase is the most likely reaction to the increase in pressure. This could happen by the pressure finally exceeding the friction force holding the projectile (hopefully, since this is the intended purpose of the gun), it could escape through the vent, or, if the pressure goes unrelieved to the yield strength of the material, it could have catastrophic failure. In any case where the volume is no longer restricted by the load, the volume becomes the atmosphere, and is therefore, practically infinite, which is why the pressures normalize after firing.
I hope all that makes sense. It's kind of late, and I'm tired.