When you take apart and look inside an automatic transmission, you find a huge assortment of parts in a fairly small space. Among other things, you see:
An ingenious planetary gearset
A set of bands to lock parts of a gearset
A set of three wet-plate clutches to lock other parts of the gearset
An incredibly odd hydraulic system that controls the clutches and bands
The center of attention is the planetary gearset. About the size of a cantaloupe, this one part creates all of the different gear ratios that the transmission can produce. Everything else in the transmission is there to help the planetary gearset do its thing. This amazing piece of gearing has appeared on HowStuffWorks before. You may recognize it from the electric screwdriver article. An automatic transmission contains two complete planetary gearsets folded together into one component. See How Gear Ratios Work for an introduction to planetary gearsets.
Any planetary gearset has three main components:
The sun gear
The planet gears and the planet gears' carrier
The ring gear
Each of these three components can be the input, the output or can be held stationary. Choosing which piece plays which role determines the gear ratio for the gearset.