A freewheel mechanism on a bicycle allows the rear wheel to turn faster than the pedals. If you didn't have a freewheel on your bicycle, a simple ride could be exhausting, because you could never stop pumping the pedals. And going downhill would be downright dangerous, because the pedals would turn on their own, faster than you could keep up with them.
The power train of a simple bicycle consists of a pair of pedals, two sprockets and a chain. The pedals are affixed to one sprocket — the front sprocket, which is mounted to the bike below the seat. The second sprocket is connected to the hub of the rear wheel. The chain connects the two sprockets. When you turn the pedals, the front sprocket turns. The chain transfers that rotation to the rear sprocket, which turns the rear wheel, and the bicycle moves forward. The faster you turn the pedals, the faster the rear wheel goes, and the faster the bike goes.
At some point — when going downhill, for instance — you get up enough speed that the rear wheel is turning faster than you can turn the pedals. That's when you coast: You stop working the pedals and let the bike's momentum keep you moving forward. It's the freewheel that makes this possible. As it turns out, the rear sprocket isn't affixed directly to the hub of the wheel. If it were, then the chain would move whenever the wheel was turning. Think of a child's tricycle, which has the pedals affixed directly to the front wheel; the wheel can't turn without the pedals turning. On a bicycle, instead of being affixed to the wheel, the rear sprocket is mounted on a freewheel mechanism, which is either built into the hub of the wheel — a "freehub" — or attached to the hub, making it a true freewheel.
The freewheel is a ratchet, a mechanism that allows motion in only one direction. In the case of a bicycle, it allows the chain to transfer power only from the pedals to the wheel, not in the other direction. The distinctive tick-tick-tick sound of a coasting bicycle, which becomes a buzz at high speeds, is the sound of the freewheel mechanism's ratchet working.
A modern multispeed bicycle doesn't have just two sprockets, but two clusters of sprockets. A 21-speed bike, for example, has a three-sprocket cluster at the pedals and a seven-sprocket cluster at the rear wheel, with derailleurs to move the chain from one sprocket to another. All the sprockets on the rear cluster are simply mounted to the same freewheel or freehub assembly.