The gas is CO2, carbon dioxide, it's given off by yeast as they eat the sugar (they're farting). The CO2 they give off, if trapped in a bottle, will eventually go back into the beer, giving it carbonation.
With kegs, you can use sugar, but you'll be using less sugar than you would if you were...