Why Gear Wheels have Teeth
There are a few ways in which one wheel can be made to turn another: by simple friction, by rope, belt or chain transmission, and by gear teeth.
At any one time in such a transmission there is one wheel that drives and one that is driven (though of course in the same pair these roles may be reversed at certain times)
Simpe friction of smooth wheels touching at their rims is unusable if the axles are at a fixed distance: the slightest wear will diminish the friction, uneven wear is worse, and in any case the force needed to turn the driven wheel must be less than the friction, otherwise slipping and hence wear will result. The only way simple friction can work is if at least one of the axles can move and is pushed in the direction of the other, thereby maintaining the friction even after some wear has happened. Such mechanisms exist but are rather rare.
Belts and ropes present the same problem of friction, but the contact area is much larger and the amount of friction can be maintained by a third wheel that keeps the belt or rope taut. These belt transmissions were widely used in industry and can be seen on mopeds and in cars where they are used for driving the alternator and other accessories.
Chains are just a special case of gear wheels: the wheels must have teeth and no slip is possible. Chain transmissions are used in bicycles and motorbikes as well as in cars to drive the camshafts.
Gears have teeth to ensure there is no slippage.
But there are two different reasons to avoid slip: one is to avoid wear when power is transmitted, the other is to ensure that the rotation angle is precise over many rotations when information is transmitted.
To see how these two are different, consider first a transmission by belt or rope: under good conditions there is no slip and no wear, but the number of turns made by the driven wheel is only approximately known from the number of turns made by the driving wheel. The diameters of the wheels are not precisely known and the effects of the expansion and contraction of the wheels, belts and ropes also influences the ratio of turns. Over a more or less long time it is impossible to predict the number of turns of the driven wheel even if the number of turns of the driving one are known. But as long as the power is transmitted, this drift of relative angle is not important.
In a clockwork however the hour hand must turn exactly once for each twelve times the minute hand turns, and this must hold as long as the clock functions: information is transmitted, not power. In an internal combustion engine the position of the cams (and hence the valves) must have a precise relation to the position of the crankshaft, and this relation must hold over all turns the engine makes while it runs. It would lead to catastrophic failure if there were even the smallest drift. Here too, information is transmitted ("the crankshaft is now at this position, the intake valve must be opened")
In both cases putting teeth on the wheels avoids bad results. For camshafts chains or toothed belts are also used, but the principle is of course the same.