Take a quad cam V6 or 8. The cams are about 2ft from the crank, and there are 4 of them. Imagine the gears that would be needed to drive that mess? But one belt, or on more modern cars a more reliable chain, does the whole job.
You're not being very specific, so I get to choose the example.
In an overhead camshaft engine, the camshaft is too far from the crankshaft to be connected by one gear on each shaft. You'd have to have one or two "idler" gears between them.
A timing belt, or timing chain, is a simpler and less expensive design solution. It doesn't require lubrication, either: a gear train would.
cheaper to maintian and easier to work on then gears. and belts are also more efficient when it comes to power loss, meaning less power is loss by using belts.
simpler, cheaper, and quieter.