According to Professor Max Shulaker, the invention of fire is what allowed apes to evolve into humans, and transistors are the next invention that is allowing humans to evolve into its next form..? Anyway, the point is, transistors are very important, and all of modern electronics are built with them.
At a high level, the function of a transistor is to either amplify or switch signals.
The most common types of transistors are bipolar junction transistors (BJT) and metal oxide semiconductor field-effect transistors (MOSFET).
Advantages of BJTs
Advantages of MOSFETs
BJTs consist of three regions: emitter, base, and collector.
In typical operation, the base-emitter junction is forward biased (p has higher voltage than n), and the collector-emitter junction is reversed biased (n has higher voltage than p). Forward biasing the B-E junction causes minority carriers (electrons in NPN, holes in PNP) to inject from the emitter into the base. (Effectively, this means that current, which moves in the opposite direction as electrons, will flow from the base to the emitter in an NPN.) This allows the base to inject its majority carriers (electrons in NPN, holes in PNP) into the base, where they diffuse into the collector. This flow of carriers creates the collector current.
There are three modes of operation for a BJT:
As the collector-base voltage increases, the depletion region at the collector-base junction increases, decreasing the effective base width, which increases current. This relation (increase in voltage causing an increase in current) can be modeled as a resistance. The Early effect is why BJTs have a noninfinite output resistance. The equivalent effect in MOSFETs is channel length modulation.
Equations:
$$I_C = I_S(1+\frac{V_{CE}}{V_A})exp(\frac{V_{BE}}{V_{th}})$$
$$I_B = \frac{I_C}{\beta_F}$$
$$\beta_F = \beta_{F0}(1+\frac{V_{CB}}{V_A})$$
$$r_o = \frac{V_A}{I_C}$$
$I_S$ is saturation current, which is a function of the device physical properties.
$V_{th}$ is the thermal voltage $\frac{KT}{q}$, which is about 25mV at room temperature.
$V_A$ is the Early voltage. It quantifies the Early effect/base width modulation of the device.
$\beta_{F0}$ is the large-signal current gain of the device when $V_{CB}$ = 0V. It can vary greatly betweeen devices.