One of the first transistors to be invented was the bipolar junction transistor (BJT), and BJTs are what most hobbyists use in home-brewed circuits. BJTs consist of two pn-junctions fused together to form a three-layer sandwich-like structure.
A pn-junction is the boundary between two different types of semiconductors: a P-type semiconductor, which contains positive charge carriers (known as holes), and an N-type semiconductor, which contains negative charge carriers (electrons).
Leads are attached to each section of the transistor, and are labeled the base, collector, and emitter. There are two types of bipolar transistors:
NPN transistor: A thin piece of P-type semiconductor is sandwiched between two thicker pieces of N-type semiconductor, and leads are attached to each of the three sections.
PNP transistor: A thin piece of N-type semiconductor is sandwiched between two thicker pieces of P-type semiconductor, and leads are attached to each section.
Bipolar junction transistors contain two pn-junctions: the base-emitter junction and the base-collector junction.
Bipolar transistors essentially contain two pn-junctions: the base-emitter junction and the base-collector junction. By controlling the voltage applied to the base-emitter junction, you control how that junction is biased (forward or reverse), ultimately controlling the flow of electrical current through the transistor. (A small positive voltage forward-biases a pn-junction, allowing current to flow, and a negative voltage reverse-biases a pn-junction, prohibiting current from flowing.)