The sprocket(s) at the rear wheel can be mounted on a freewheel or freehub, depending on the design of the wheel hub.
Inexpensive, versatile and easy to replace. The freewheel has the advantage that the bearings are contained inside the cluster of sprockets. This means that you get a new set of bearings when you replace the freewheel unit. Removing this unit requires just one tool to unscrew it from the wheel, while changing the number of gears can be as simple as fitting a different freewheel unit. New multi-speed freewheel units are available with 5, 6, 7 sprockets. Freewheel units are also available in single speed, as seen on BMX bikes. Different manufacturers freewheels are cross-compatible although they need different tools to remove them from a wheel.
The freehub was developed for the sports market to be lighter than the freewheel. The bearings are contained within the hub of the wheel and are relatively difficult to replace.
For instance, a 7-speed freehub is designed only to take a 7-speed cassette. An 8-speed freehub will take an 8, 9 or 10 speed cassette. Removing the cassette requires two specialist tools. 9-speed, 10-speed and 11-speed freehubs require narrower chains and the system wears out quicker. Unfortunately, 7-speed freehubs are now considered obsolete by many manufacturers. See Sheldon Brown’s website for detail.
There have traditionally been two main manufacturers of this type of system, Shimano and Campagnolo. They each have a proprietary hub design and the cassettes are not cross-compatible.