Some gases dissolve in some liquids.
A hot liquid can hold much less gas than a cold one.
Liquids under pressure hold much more gas than when they are not under pressure.
This is why, when you take the cap off a fizzy drink bottle, gas bubbles are produced. When lava comes out of a volcano the gas is expelled instantly, causing the lava to be blown apart and produce ash.