How a distributor works
The distributor handles several jobs. Its first job is to distribute the high voltage from the coil to the correct cylinder. This is done by the cap and rotor. The coil is connected to the rotor, which spins inside the cap. The rotor spins past a series of contacts, one contact per cylinder. As the tip of the rotor passes each contact, a high-voltage pulse comes from the coil. The pulse arcs across the small gap between the rotor and the contact (they don't actually touch) and then continues down the spark-plug wire to the spark plug on the appropriate cylinder. When you do a tune-up, one of the things you replace on your engine is the cap and rotor -- these eventually wear out because of the arcing. Also, the spark-plug wires eventually wear out and lose some of their electrical insulation. This can be the cause of some very mysterious engine problems.
Older distributors with breaker points have another section in the bottom half of the distributor -- this section does the job of breaking the current to the coil. The ground side of the coil is connected to the breaker points.
A cam in the center of the distributor pushes a lever connected to one of the points. Whenever the cam pushes the lever, it opens the points. This causes the coil to suddenly lose its ground, generating a high-voltage pulse.
The points also control the timing of the spark. They may have a vacuum advance or a centrifugal advance. These mechanisms advance the timing in proportion to engine load or engine speed.
Spark timing is so critical to an engine's performance that most cars don't use points. Instead, they use a sensor that tells the engine control unit (ECU) the exact position of the pistons. The engine computer then controls a transistor that opens and closes the current to the coil.