I have explained the manufacture of carbonated beverages before so I’ll be very brief: Water is treated to sterilize it, then, still warm, it goes into a scrubber to remove the air. This is a tank with a vacuum where the water is sprayed in a fine mist. Having removed as much air as possible, the water is now chilled. It is mixed with the syrup carefully measured to ensure correct output brix. (You realize the syrup has its own set of problems, dissolved air being one of them.) Now the beverage is carbonated by injecting the CO2 and the carbonated beverage goes to a storage tank. That is the end of the manufacturing process. From here it goes to the filler which has a central tank. Up until this point, since the water was scrubbed of oxigen, it has not been in contact with air again. The tanks are all filled with CO2 and the whole thing is under pressure.
The tank of the filler is also under pressure and topped with CO2. The filler goes around at great speed. The container (can or bottle) is placed under the nozzle, pressure is equalized, filling starts, when the container is full, filling stops and, as the container leaves the filler for the machine which will put the top (of the can or bottle) pressure is removed and the container is open to the atmosphere. This process moves extremely fast and the containers are shaking around. Any air dissolved in the beverage is going to cause foaming and air is about the only thing which will cause foaming (well, and high temperature). Air gets into the beverage while filling mainly but also maybe by insufficient scrubbing, the beverage (or sometimes, it seems, magic).
The point here is you want to fill (I)as fast as you possibly can (II)at the highest possible temperature (saves a lot of energy (=$), (III)while avoiding foaming.
I was in charge of the machine which manufactures the beverage but the filler was from another vendor. When we had foaming problems (i.e. every day) I generally thought the problem was with the filler while the filler guy usually thought the problem was with the beverage I was sending him. When you start having problems the first thing is to slow down the filler as a filler might be able to fill 100 bottles a minute and will foam like crazy at 150 BPM.
So, you see after filling but before capping the container is (I)open to the atmosphere and (II)shaking around a lot. When it is capped you can be sure there is a lot of air in there.
As I said, oxigen dissolves in water much more readily than CO2 and will displace it.
Note that during the entire manufacturing process the carbonated beverage is moving around and being shaken much more than you can shake it in your hands. Yet, in the absence of dissolved air, the carbonation stays long enough to cap the bottle. With any dissolved air the beverage foams explosively to the point where you may lose most of the beverage before capping.
In the total absence of air, (supposing only CO2 in the bottle) if you shake it I would imagine the pressure would rise but nothing compared to what happens with air, even if not much.
I have also mentioned: Most bottling plants can be visited by the public. Call your local Coke or Pepsi bottling plant and ask them when you can take a tour. They’ll be happy to show you all this, treat you to a sample of their products and give you a pen and a baseball cap with their logo. 