More in-depth explanation of how it works

This is about an NPN-type silicium BJT but if you change the words electron/hole and positive voltage/negative voltage it applies to a PNP-type, too

Basic setup

You connect the transistor like this:
           +Vcc
             A
             |
             |
          | /
          |/
     -----|
          |\
          | J
             |
             |
             |   
            GND         
, that's the collector to a positive voltage, the emitter to ground. Now you start playing with the base...

Base voltage < 0.7V

In this case, both the base/emitter and base/collector-diodes are closed. No current will flow.

Base voltage rises above 0.7V

Now the base/emitter-diode will begin to open up, as the voltage from base to emitter raises above the threshold voltage of the p-n junction. A current begins to flow from the base to the emitter. At this point it's important to be aware of the electron densities:

nnnnnnnnnnnnnn|        |nnnnnnnnnnnnnn
              |n       |
  emitter:    | nn     |  collector:
  electrons   |   n    |   electrons
    are       |    n   |     are
  majority    |     nn |   minority
  carriers    |       n|   carriers
--------------+--------+--------------
  EMITTER        BASE      COLLECTOR

From the open base/emitter-diode electrons come flowing in, raising the electron level far above the normal level. At the same time, the base/collector-diode is closed. So the electron level on the collector side is low, even lower than normal... resulting in a steep slope of the electron level! And as we know from the Einstein relation, this is the same as a large current from collector to emitter (as electrons carry a negative charge, the current direction is opposed to the actual direction of the carrier's movement).

One could say that the open base/emitter-diode is pumping electrons into the base, while the closed base/collector sucks them out. The base is usually constructed to be very short. This keeps the slope steep and therefore the collector current high; also so there is virtually no room for recombination: the electrons are being sucked out before they can recombine. This improves the efficiency: Electrons that recombine in the base don't contribute to the collector current.

So that's what makes up the transistor: You introduce a current into the base, but end up changing the collector current! It's important that it's actually the current you inject into the base that controls the collector current flow, not the base voltage.

To build an efficient transistor you must

  • Make the base short so there is only little recombination
  • Dope the emitter much stronger than the base. When opening up the base/emitter-diode, majority carriers from both sides begin to flow; when there are more majority carriers in the emitter, the flow of electrons into the base is higher than the flow of holes into the emitter.

Base voltage near +Vcc

When the base/collector voltage gets lower than 0.7V, that diode begins to open up, too. This results in a rise of electrons at the collector side of the base. As there is less difference between emitter and collector side, the slope and therefore the collector current decreases.

This behaviour is called saturation because the base becomes saturated of minority carriers. Note that this is opposed to the FET terminology.