Googled around to figure this out but it was unclear, so, I'll explain.
Engine spins stuff. That's like the job of an engine. You know its spinning super fast cause the pitch goes higher.
Once it goes too high, it makes stuff spin SUPERFAST. This cause (simplifying GREATLY) a set of breaks inside the transmission to stop working (cause SUPERFAST) which then triggers a gear shift.
PS its a lot more complex than this but that's simplified.