You no doubt know which type of gearbox you prefer, be it automatic or manual. Do you know how these gearboxes do what they do? If you don't, then today is your lucky day.
This video from Learn Engineering starts off with the basics of how a manual transmission works. It comes down to three shafts, an input shaft, an intermediate shaft, and an output shaft. The input shaft spins with the engine. It is connected to the intermediate shaft, so the intermediate shaft is always rotating. In turn, the intermediate shaft is connected to the output gears, but those gears are not fixed to the output shaft. A hub and sleeve activate the output gears by connecting them to the output shaft. The different sizes of the output gears create the different gear ratios. A clutch is needed to disengage the gears, and therefore interrupt the power, so the gears can mesh during gear changes.
There's a bit more to it than that, so it's best to watch the video.
Next up is the automatic transmission. Instead of gear pairs, the automatic has planetary gear sets around a sun gear and inside a ring gear. A carrier connects the planetary gears and includes an output shaft. The ring gear is an input and the sun gear has an input shaft. Adding a second planetary/ring/sun gear setup and connecting it to the first adds more gears. Clutches around the two ring gears allow the transmission to shift gears without interrupting power. The basic principle of the system is to vary the input speeds to change the output speed.
All of this is much easier to visualize when you watch the video.
Now that we know how these transmissions work, the video explains the differences and the advantages and disadvantages.
The manual is simpler. It's easier to repair, and it costs less.
The automatic is more compact. It costs more, but it drives smoother and it is more durable.
Finally, the video gets into how these transmissions deal with braking. In a manual, you must engage the clutch when coming to a stop or the car will stall. You can also downshift to use engine braking to help slow the vehicle. An automatic uses a torque converter to separate the engine rotation from the transmission. It allows slippage, but also generates heat and therefore has an adverse effect on fuel economy.
Again, this video goes into far more detail on all of this, so give it a watch and you will learn the inner workings of your transmission.