How does the manual transmission work?
The shift cable is connected to a selector lever that has different positions, one for each gear. The gears are attached to a set of gears in the transmission case, and those gears mesh with the drive wheels (or sprockets on bicycles).
When you press the clutch pedal, it disengages the engine from the driveshaft so that no power is transmitted through the crank shaft to the wheel or axle. With your foot off the gas but still depressed on the clutch pedal, you can now use the selector lever to select which gear you want the car to be in by moving it towards the desired gear position. When you let go of the clutch pedal, the friction between the two sets of teeth hold them together until another push down moves the selector back into its neutral position where the transmission will not allow any further movement without first releasing the clutch pedal.