Our cars run at different speeds in different conditions. When you set off for a journey, different types of road conditions require your car to run at different speeds with efficient power. So how do we obtain different speeds in the car with maximum torque and RPMs? This is all achieved with the help of a gearbox. It allows you to drive through hilly terrains, traffics, and cruise through the highway at maximum RPMs. The gearbox also helps to reverse your car without changing the direction of revolution of crankshaft.
There are multiple gears in the gearbox that have different gear ratios. The lowest gear in the car has the highest torque and minimum RPMs. Whereas the highest gear has the lowest torque and highest rpms.
The gearbox is placed second in the transmission line just after the clutch which is placed between engine and gearbox. Generally, there are 4 to 6 gears in modern cars and more than 6 in the heavy-duty vehicles including reverse gear as well.
Types of gearbox
Sliding mesh gearbox
It is one of the simplest one in working. It was used since the starting of automobiles manufacturing. Today most of the gearboxes are based on sliding mesh mechanism. When a driver shifts gear, the other end of the gear lever having selector fork slides the gears on the output shaft.

As fork gear slides, it meshes with the other gear on the countershaft. Hence, the power is transmitted through the engine to driving wheels in this sequence- engine→countershaft→meshed gears→output shaft→wheels
Constant-mesh gearbox
The working of a constant mesh is similar to the sliding mesh gearbox, but with some changes. In constant mesh, the gears on the output shaft are always in mesh with the gears on the layshaft.

Also, here dog clutch is used for engaging gears instead of selector fork. Dog clutches are square toothed wheels that slide over the splined output shaft. When a dog clutch is engaged with a gear on the output shaft, a specific gear ratio is obtained as gears on the output shaft are in constant mesh with the other gear on the layshaft.
If any of the dog clutches are not in contact with the gear, then there is no power transfer. This is a neutral position. Reverse gear is also obtained using an idle gear between output gear and layshaft gear.
Synchromesh gearbox

It works similar to constant mesh gearbox. It has all the parts and arrangements similar to sliding and constant mesh gearbox. The only difference is that it has a synchronizer which works similar to friction clutches. When a selector fork slides synchronizer, a small friction disc gets pressed against the gear. Hence, the required gear ratio is obtained.