Sorry if this is long I am attempting to describe my entire thought process :
I am considering a situation for a barrel/cannon. There is a propellant (can be a cartridge filled with powder or what have you), and a projectile ( a bullet or cannonball), and they are encompassed in a barrel or tube. Left/back is the closed end of the tube and right/forward is the open end of the tube.
The powder will sit at the back of the tube in a closed end, it will explode, and after a complete ideal chemical reaction will turn into high energy gas that will begin to push on the projectile. The projectile will act as a moving wall and will obturate any gas behind it, allowing no leakage past it. As the cannonball moves down the tube, its gain in momentum due to the explosion in one direction, will cause the cannon to move backwards in the opposite direction due, to conservation of momentum. Picture for Reference
However it is my understanding that the expanding gas that is moving behind the cannon will not cause a backwards motion until the cannonball has left the tube and allowed the gas to leave the tube causing a kind of thrust/jet propulsion due to the gases finally being able to leave jet out. I am almost certain this is how it would function, because I can compare it to blowing up a balloon, while the balloon may expand while blowing it up, it does not fly away. The moment I let go of the balloon and allow gas to escape out the mouth hole, the balloon starts flying around the room due to the gas escaping from the balloon.
My question is why does the expanding gas not cause thrust while inside the tube? It would make sense that the gas is moving on average down the tube with the cannonball?
The way I've justified it on a molecular level is that the high pressure gas inside the tube experiences gas molecules constantly hitting it on the left closed wall and right on the cannonball that is blocking the tube. Thus it experiences no net forces when the cannonball is moving down the tube. However when the cannonball leaves, the tube only experiences gases pushing back on the closed end of the tube, and those gases which were equalizing this force by pushing oppositely on the cannonball, are instead simply leaving and no longer cancelling out leftwards forces. Thus the tube experiences a net force backwards when the gases are allowed to jet out of the tube. But this is in terms of molecular forces (and perhaps Newton's 2nd Law) but I want an explanation in terms of conservation of momentum.