The cannon is very warm compared to the LN2. When the LN2 is poured into the cannon, the cannon starts to warm it up. When you heat a liquid it turns into a gas.
Gases take up much more space than liquids.
As it expands, the Nitrogen tries to take up more space, but the cork is stopping it. After a second or so, the Nitrogen is pushing hard enough to pop the cork out. Like any projectile weapon, don't fire the cannon directly at anyone. When the cork is ejected, some LN2 also flies out the barrel. If the cork gets stuck, open the valve before you start messing with it and trying to free it.