That is, the carbon dioxide gas is dissolved in the liquid soda, and the soda bottle is pressurized to keep the carbon dioxide gas dissolved in solution.
However, some of the carbon dioxide comes out of solution and goes into the air above the liquid.
This is why you can observe bubbles forming in the Coke and rising to the surface of the soda, and this is also why bottles of soda which have not yet been opened are hard, because the gas within the bottle creates a high pressure environment.
When you open a bottle of soda and pour some into a glass, you can see many bubbles forming in the soda that bubble up to the surface of your drink.
The glass gives the carbon dioxide gas a surface from which bubbles can form.
When salt is poured into the soda, each grain of salt provides a series of rough surfaces on which carbon dioxide can come out of solution and form into numerous bubbles.
Each grain or crystal of salt is rough and has a lot of surface area on which multiple carbon dioxide bubbles can form.
As more bubbles form and cling to the surfaces of the salt crystal, the carbon dioxide gas bubbles become more and more buoyant.
That effect is multiplied by the number of grains which are poured into the soda (which is a lot of crystals of salt), resulting in an enormous number of tiny carbon dioxide gas bubbles gaining more and more buoyancy, thus increasing in pressure and seeking to rise to the surface.
As the carbon dioxide bubbles rise to the surface, they push all the soda in the way to rise up as well, creating a foamy geyser effect that shoots up out of the bottle and overflows to the surrounding area.
Nucleation is defined simply as the process in which matter starts to change from one phase or state to another phase or state.
Thus, the nucleation that takes place during the reaction of the salt with the Coke is the rapid changing of dissolved carbon dioxide gas (in solution) into all the carbon dioxide gas bubbles that form on or around the surfaces of the thousands of crystals of salt that are poured into the Coke.
A Mentos candy has a rough surface and possesses a fairly high ratio of surface area to volume, thus providing the carbon dioxide gas with ample surface area to form numerous bubbles, which in turn create even more bubbles.
Mentos candy is relatively dense and will drop to the bottom of the bottle quite fast, allowing for the speedy formation of bubbles. Mentos candy that has been crushed sinks more slowly to the bottom of the Coke bottle and creates a much less explosive foam fountain that is significantly shorter in height.
The surface tension of the liquid affects how fast bubbles will form. Lower surface tension will allow bubbles to form more quickly. Research has shown that gum arabic, a surfactant which is contained in the coatings of Mentos candy, serves to reduce surface tension in liquid, which results in taller fountains from Mentos candy (as opposed to other mints with rough surfaces which were tested that lack gum Arabic).
Note: Using Diet Coke in this reaction also creates a much taller, more explosive geyser than using regular Coke, because the aspartame used in Diet Coke gives the liquid lower surface tension than the sugar used in regular Coke.
Diet Coke produces a much larger explosion overall, whether you use Mentos candy or salt for the reaction. Foam geysers as high as 10 meters have been reported with the use of Diet Coke.