Carbon dioxide is a colorless, odorless gas that is created as a byproduct by most strains of yeast used in home fermentation.
When fermentation takes place in an enclosed space, as with a bottle conditioned or cask conditioned beer, the increased gas pressure forced the carbon dioxide into solution, carbonating the liquid. Pressure can also be applied using a canister of high-pressure carbon dioxide to carbonate the beverage; this is known as force carbonation.