The thing that makes brewing beer work, or, more generally, the thing that makes ethanol in general, is yeast. (Now, you can synthesize ethanol, industrially, through the hydration of ethylene, but this involves using some nasty chemicals that don’t belong in something you plan on drinking.) Yeast, as you probably know, eats sugars in your beer and (as Tim likes to put it) poop out alcohol.
Yeast is a single-cell fungus, which is found just about everywhere. All types of yeast reproduce asexually, though there is a process of genetic material exchange between cells. The yeast species you are probably most familier with is saccharomyces cerevisiae, ale yeast. This is actually the same specie as baking yeast, but in general, brewers use a less aggressive yeast strain that produces fewer unwanted chemicals that would give the beer an undesireable taste. Saccharomyces carlsbergenis, called so because it was first isolated by Carlsberg, also known as saccharomyces pastorianus or lager yeast, is, unshockingly, used in lagers. Saccharomyces carlsbergenis is a combination of saccharomyces cerevisiae and a third type of yeast, used mostly in wine and ciders, saccharomyces bayanus.
The thing most important for your beer that you need to know about the differences in these yeasts is that lager yeast generally has higher attenuation, meaning it can eat more sugars, leaving your beer more dry (though the variation in strains of each lager and ale yeast provides a large overlap), and that it works at a colder temperature (about 10-15 F colder) than ale yeast.
All alcohol-producing yeast can work in two different ways, based on if there is oxygen around or not. When yeast eats sugars without oxygen, the yeast gives off the waste of ethanol, and carbon dioxide, along with some energy. This energy does two things, it powers the yeast cell, so it can grow, and warms the liquid it is in. When there is oxygen present, the yeast cell can completely break down the sugar into water and carbon dioxide. This produces significanly more energy for the yeast cell, which lets it grow much faster.
When you add your yeast to your wort, you want some oxygen to rapidly grow your yeast so fermentation doesn’t take a long time. Once the yeast has consumed all the oxygen in the wort, it then switches to anarobic fermentation (without oxygen) and makes ethanol. If you have a large quantity of yeast cells to start with, you don’t have to oxygenate your wort as much, and you’ll get higher alcohol concentrations (and less water) in your beer.
Another stat you may see on the side of your yeast pack is ‘flocculation’. Flocculation means the ‘clumping’ of yeast cells in your beer. This sounds like it might be a bad thing, but actually it’s good. When your yeast cells are done eating sugars, they can do one of two things: with yeast that has a low flocculation, it will just sit suspended in the beer. High flocculation means the cells will clump together and float to the top, in the case of ale yeast, or sink to the bottom, in the case of lager yeast. This will make your beer clearer. Some beer styles are traditionally cloudy with yeast, and has a slightly different taste because of it.
Some of you may notice I didn’t mention brettanomyces, a genus of yeast used in making lambics. This yeast is naturally found in the air in the southwest of Belgium. Lambics are made, not by adding yeast directly to the wort, but by allowing them open access to the air. The yeast particles in the air fall into the beer, instead of physically putting a yeast solution into the beer. This yeast gives lambics a distinctive sour taste. This open fermentation, you might think, wouldn’t work, because it isn’t separated from the air. If the wort is exposed to the air, it will have access to oxygen, and the yeast would never anaerobicly ferment the sugars into ethanol. However, if you remember part of what is released is carbon dioxide. CO2 is heavier than air and sits on top of the wort, creating a barrier between the oxygen in the air and the wort, allowing fermentation.
There are many different strains of each of these species of yeast. Each have slightly different characteristics that will produce slightly different results. More or less flocculation, more or less attenuation, higher or lower prefered fermentation temperatures, etc. These allow you to fine tune your beer, in a general sense, the important distinguishing factor is ale yeast, lager yeast, or lambic yeast. This hopefully helps you understand how yeast works, and gives you a better idea as to what is happening inside your carboy.