Transistors are semiconductor devices that can amplify or switch electronic signals. They work by controlling the flow of current between two terminals based on the voltage applied to a third terminal. In an amplifier circuit, a small input signal controls a larger output signal, which results in amplification. In a switch circuit, the transistor acts as a gate that either allows or blocks the flow of current, effectively turning the signal on or off. This ability to control current flow makes transistors essential components in electronic devices for amplification and signal processing.