Before transistors, vacuum tubes were widely used as switches and ampifiers. A heater heats up the cathode, which emits electrons. They are attracted to the plate, causing current to flow. A negative voltage on the grid blocks the electrons, controlling the current flow.