system
Given the following post, respond as if you're commenting on Reddit:
human
Just how on earth does a transistor physically work? How is the direction of an electric current changed without moving parts, and how is this signaled?

Despite the extraordinary prevalence and use of computers and of the relative ease with which one can learn basic programming skills, I don't think I have ever seem a decent description of just how in the hell the most basic part of modern computers actually operates. Every explanation I've been given seems to miss the point of what I was asking. I know a transistor works a bit like a switch without moving parts, but how does it do that? How do you signal it to do that without moving parts? Isn't this turtles all the way down?
gpt
Imagine three layers. Current wants to flow from 1 to 2 and from 3 to 2, but not the reverse direction for either, like two waterfalls that flow down into the same river. To be "on," you need it to flow from 1 to 3. Applying a voltage to layer 2 raises the metaphorical river to the point that the waterfalls disappear and the current can now flow easily from layers 1 to 3.

From a materials perspective, layers 1 and 3 have a built in positive voltage, with layer 3 having a slightly lower voltage than layer 1. Layer 2 has a built in negative voltage. Applying a positive voltage to layer 2 overcomes the built-in diodes created by these junctions.