The short answer
In the traditional method, the wine ferments a second time, inside the already sealed bottle. This produces carbon dioxide, a gas. It can't escape, so it dissolves into the wine. When the bottle is opened, it turns back into gas, and that's the fizz in your glass.

