What makes a cola foam up when you put a pretzel in it?

The cola foaming up when a pretzel is put in it is a physical interaction, not a chemical reaction. It works with other carbonated beverages too. Carbonated beverages when opened and released from pressure or supersaturated solutions of gas with more carbon dioxide dissolved in the beverage than would be possible at normal pressures.

 Left alone for two hours, the drink would slowly lose the gas and go flat. Sodium chloride particles seem to provide an especially good surface for gas to collect on, form bubbles and quickly rise to the surface and escape.