According to Henry's Law, the solubility of a gas in a liquid is directly proportional to the pressure of the gas above the liquid. Opening the bottle releases the pressure, causing the dissolved CO₂ to come out of solution.