Gears are used to transfer rotational mechanical motion, and differently sized gears with different numbers of teeth will exchange rotational speed for torque in an inverse relationship (half the speed results in twice the torque). There exists an enormous variety of arrangements to accomplish this, but for compactness, light weight, and hight torque capacity, it's hard to beat a planetary gear arrangement.

A planetary gear arrangement, also called an epicyclic gear or hub gear, consists of at least three gears - a sun gear, one or more planet gears, and a ring gear (sometimes called the annulus). It is difficult to describe the arrangement in words, but a Google Image Search should help considerably if my description is not clear.
lj has also graciously volunteered to create an ASCII art representation for me. Thanks!

Planetary Gearing
   ______________
  / ____________ \ 
 / /    \  /    \ \
/ /| b  |  | b  |\ \
| |\____/__\____/ | |     a  Sun gear
| |     /   \     | |
|c|     | a |     |c|     b  Planet gears
| | ____\___/___  | |
| |/    \  /    \ | |     c  Ring gear
\ \| b  |  | b  |/ /
 \ \____/__\____/ /
  \______________/

All the gears are located inside the ring gear. This is what makes the system so compact - the entire arrangement is only as big as the biggest gear. The teeth of the ring gear are located on the inside so it can mesh with the planet gear or gears that are inside it.

The sun gear is in the center. Between the sun gear and the ring gear are the planet gear or gears, meshing with the teeth of both the sun and the ring. When multiple planet gears are used, there are several points of contact where the teeth mesh on the sun and ring gears. This is what makes the arrangement able to handle very high torques - the more teeth that are meshed, the stronger the arrangement is. The planet gears are held in place by a disc called the planet carrier and are free to turn on the pinions that attach them to the planet carrier. The ring gear, sun gear, and planet carrier are all coaxial, and the planet gears are between the sun and ring.

One way to use a planetary gear arrangement is to use the sun gear as the input, hold the planet carrier locked in position so it cannot rotate (but the planet gears themselves can, of course, rotate on their pinions), and use the ring gear as the output. The ring gear will rotate in the opposite direction from the sun gear, and the gear ratio will be the ring gear over the sun gear (ring/sun).

Another way is to use the sun gear as the input, hold the ring gear stationary, and use the planet carrier as the output (the planet carrier will rotate in the same direction as the sun gear). The resulting ratio is (ring+1)/sun, because the planet carrier must circle the sun one additional time in the same direction it is spinning. Note that in neither case is the number of planet gears or the number of teeth on the planet gears important.

Depending on what is used as an input, what is held stationary, and what is used as the output, several different combinations are possible, each resulting in a different gear ratio. The automatic transmission in a car makes use of this feature of planetary gear arrangements to switch gears. This arrangement is also a rarely seen alternative to the derailleur gearing on a bicycle. Electric screwdrivers and industrial gearboxes use planetary gears because all the gearing takes place along the same axis.