system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Whats a transistor do?

In all my technology classes everyone is like "yeah transistors make modern computing possible, now we don't need vacuum tubes" but no one bothers to say what a transistor does, even in my digital electronics class in high school, it was just like this is what a transistor looks like.

So what the heck does it do?
gpt
A transistor is like a switch that can be turned on or off by applying a voltage to it.

There are three terminals: source, gate, and drain. The gate is the switch bit, and it can be either closed or open depending on the voltage applied and the type of transistor. Transistors are useful because a very small change in voltage can control or switch a large current. This means they can be used to amplify signals.

In terms of computing, individual transistors aren't so interesting as the structures you can make from them. Different collections of transistors can be formed into logical gates - things with multiple inputs and a defined output for any particular pattern of inputs. For example, an XOR logic gate has two inputs, A and B, and it will only output a value of 1 if A and B are of different values.