Transistors are important components that are used in a variety of applications. Some types can be used for switching, some for amplification or both. Other transistors perform exclusive tasks, such as the phototransistor, which responds to light by producing a current.
The main premise of a transistor is that by feeding a transistor a source voltage or current (depending on the type), the transistor allows for the passage of electrons. This process is accomplished through pnp or npn semiconductor structures. The following diagrams provide a general example of the function of a transistor:
Bipolar Junction Transistors (BJT) are controlled using a biasing current at the base pin. This means that they will also consume more current than other transistors such as the FET. One advantage of BJT transistors is that they offer greater output gain than an FET. However, BJT can be much larger in size than FET and for this reason, they are less popular, despite being easier to manufacture.
Field Effect Transistors (FET) are voltage-controlled. For this reason they essentially draw no current and therefore do not pose a substantial load to a circuit. FETs are not as useful for gain as BJT, however if the intent is not for amplification then this is not a problem. FETs can be manufactured very small and this is important in manufacturing integrated circuits that use many transistors. FETs and especially the MOSFET subtype are more expensive to manufacture, but remain more popular than the BJT.
Some FET transistor types are even constructed on the nano-scale. The FinFET for example is about 10 nm, currently used by Intel, Samsung and others.