The Fermentation Process
The gas in real ale is naturally occurring carbon-dioxide (CO2), which is a bi-product from the fermentation process, specifically the action of the live yeast on the sugar during the fermentation. Yeast is a type of fungus found in many forms. The other bi-product from the reaction between the yeast and the sugar is of course alcohol.
Yeast reacts with an effectively 'eats' the sugars, producing alcohol and CO2, which creates the fizz.
Even at the point of drinking from the glass, real ale is still a 'live' product.