Transistors are electrical devices with three electrical terminals. They work a little bit like a tap works for water. Adjusting the tap handle (terminal 1) with very little force affects the flow of a large amount of water from Terminal 2 (the input) to Terminal 3 (the output).
In a transistor, a small electrical current or voltage at terminal 1 can be made to affect the electrical resistance seen by an electrical current flowing between the other two terminals (2 and 3). The resistance can be made small – allowing a big current to flow, or large, switching off the current altogether. In this way transistors can be used to amplify a small ‘signal’.
In computers, transistors can be made to switch currents on and off billions of times in a second encoding digital information.