Driving a car with a manual transmission or "stick shift" as it is commonly called, is a lost art for many people on American soil. Once the standard for transmissions, manuals require more skill to drive, and can be frustrating to learn to operate well. However, there is a tradeoff in benefits.
One benefit is fuel economy. Because of the way an automatic uses a fluid coupling, efficiency is never 100%. By contrast, with a manual transmission, the wheels and engine are directly connected most of the time, so energy is not wasted. Another benefit is performance. There is a reason race cars and other high performance vehicles are usually manual transmission. That reason is that even the best automatic transmission cannot anticipate what the driver wants the car to do next. While an automatic transmission is simply reacting to the needs of the driver and conditions of the road, a driver using a manual can shift into the proper gear slightly before it is needed. Downshifting and other advanced uses of the direct link between engine and wheels are other advantages available to a driver of a manual transmission vehicle.
The goal of a manual transmission is to regulate the speed of the wheels. The engine of a car or any other vehicle has a limited range within which it is most efficient, and usually another small range within which it generates the most power. For a small passenger car, the efficient range is around 2000 RPM, and peak torque is generate around 3000 to 4000 RPM. Redline, the speed at which the engine begins to damage itself by running too fast is around 5000 RPM, and the tachometer will probably top out at around 6000 RPM.
While the best range to operate the engine is narrow, the speed of the vehicle itself will vary quite widely. Furthermore, high torque is generally needed at low speed while low torque is needed at high speed. This is because less energy is required to keep something moving than get it moving in the first place.
If the engine were directly coupled to the wheels, the car would be only possible to start by rolling it. Then, once moving, it would be quite close to stalling until up to about 20 MPH. For higher speeds, the engine would have to race, wasting fuel, and reaching highway speeds would be impossible.
A transmission is a set of gears that allow the engine to run quickly when the car is at low speed, and to run more slowly when the car is at high speed. Unlike a bicycle, which uses a chain and sprockets, an automobile transmission uses gears that are all always engaged. However, while the gears are continuously engaged with each other, they are not always engaged with the driveshaft, and may freewheel directly around it. The task of coupling the gears to the drive shaft to the gears falls to the dog gears.
A main gear has teeth around the edge, like ridges on a dime. A dog gear has teeth in line with the axis of rotation. When these teeth engage with holes in the side of the main gear, that gear will turn. If you shift poorly and hear a grinding sound from the transmission, it's not the gears grinding on each other. The gears are always meshed. The grinding sound is coming from the dog gear and a main gear grinding on each other.
The dog gear is moved directly by the shifter lever, which protrudes up through the floor of the car. Selecting a different gear on the lever moves the dog gear along the driveshaft. While the dog gear is always turning with the shaft it rides on, the main gears freewheel on that shaft, unless meshed with the dog gear. The shift lever basically controls which main gear the dog gear is meshed with, and therefore which main gear is transmitting power from the engine to the wheels.