Why cars have transmission gears? Cars need transmission to efficiently vary the speed of the wheels and this due to the fact that the internal combustion engines have a very limited torque band.
What I don't understand is why engines produce a narrow spectre of torque values?
 A: There are many factors that limit how an engine produces its effective torque band and at what speeds it does that.
I am not going to go deeply into these points, as some have a lot behind them.
First the fuel has a finite defined time to burn completely and the faster the engine rotates the less time for the power stroke...
Then there is the opening and closing of the inlet and exhaust valves which will have an effect on the torque characteristics.
So there are "road" cams designed to give the "average" user an "easy" engine to drive. Then there are "road/rally" cams which increase the power and torque output but make the car more challenging for an "average" driver. Then again there are "race" cams which are even more challenging - seen this once where people were tested in a race car and only one managed to pull away without stalling it multiple times...
Then there is the ratio between the stroke of the engine (distance traveled by the piston related to the throw of the crankshaft) and the bore diameter.
Undersquare engine with bore less than the stroke tend to be slow revving higher torque delivery engines,
while oversquare engines bore larger than stroke are high revving with lower torque - so this is why small motorcycle engine tend to be high revving 12,000 or 14,000 or more compared to car engines that "only" rev to 6, 7 or 8 thousand revs min.
So the "best" working range of the engine (power & torque) needs to be matched to the speed range required for the vehicle. This is why there are some engines that appear in cars that are also used in trucks as they use different gear ratios to meet the requirements. A truck can have 6 forward gears and only have a top speed of 80mph for example while a car with the same identical engine may have a top speed of 180mph...
My answer here is also relevant:
https://engineering.stackexchange.com/a/18209/10902
A: Solar Mike's exposition can be summarized as follows. The engine produces varying combinations of torque and RPM over its normal range of operation; the product of these variables at all points being equal to power. 
Power is the thing which accellerates the car and maintains its speed in the face of friction from air and the rolling action of its tires. The driver then selects a transmission gear ratio which furnishes the best impedance match between the output impedance of the engine and the impedance of the load, which maximizes the amount of power delivery from the source to the load.
That gear ratio selection can be made on the basis of maximizing acceleration (which requires both torque and RPM to be maximized), or minimizing fuel burn for best economy (which requires minimizing RPM), or maintaining constant speed while climbing or descending a hill (which requires adjustment of both torque and RPM). 
A: Just to add one more angle: this question is implicitly about internal combustion engines.
External combustion engines such as steam locomotives do not need gears, because there is no slowest speed for a steam cylinder. Internal combustion engines are, in this sense, more sensitive as to speed ranges than external combustion ones (and more sensitive about fuels as well; though they have advantages in other ways).
