While "modern" cars now use computer relay controlled distributor modules, "older" cars, in order to trigger combustion in the cylinder at the proper time, use a mechanical Distributor (consisting of a Cap, rotor and coil).
In early engines that needed a spark, the spark was often sent to each spark plug regardless of what stroke its cylinder was in -- this was because it made the mechanics of the distributor very easy, but it also damaged the performance of the engines. In order to fix this, a distributor was needed where a spark was only sent to the combustion chamber that was at the top of it's Compression stroke. A common way many internal combustion engines produced in the latter half of the 20th century accomplished this through the use of a design called the Hall Effect Distributor. Other solutions for this problem are Ignition Point Distributors and Optical Gap Distributors -- though Hall Effect Distributors are very cheap to produce and very reliable so they have become very popular.
The Hall Effect is a curious phenomenon discovered by Edwin Hall in the late 1870's; if an electrical current is passed though a conducting substrate and interdicted with a magnetic field the distribution of the electrons passing through the material will be altered predictably. This means you can sense when a magnet is close to the conductor by the electron shift.
The idea is pretty simple. Okay, so it's not really that simple, but at least it's difficult to explain. A typical design (example taken from my 1984 Dodge Aries) is that there is a sensor, rotor and a cap.
The sensor has, predictably, the Hall Effect Sensor on it (which in this case is little more then a piece of metal with a charge going though it). On top of this will be a rotor which rotates (spins) by a shaft from the engine. This rotor will have two electrical contact points on it (one for input and one for output; the input will characteristically be on the top on the rotors rotational axis) and, in the case of my car, a metal "gear" with the square "teeth" (4 of them, four cylinders) pointed down. The cap covers this all up and will also have the electrial input from the ignition coil and the outputs the individual spark plugs.
When the engine is running, the rotor is spining, and thus is the metal "gear" part of the rotor is as well. The "teeth" move circularly through a gap between a fixed magnet and the Hall Effect Sensor. When the teeth move through this gap, the electron electron flow in the Sensor is changed and can be detected. The rotor and it's "gear" are placed so that when one of the "teeth" coincide with the sensor/magnet assembly the electrical output contact on the rotor is aligned with one of the outgoing spark plug contacts on the cap.
The basic upshot of this is that when the Hall effect is produced, all the various parts are already lined up to make an electrical path from the ignition coil to a particular spark plug. Even though then output terminal on the rotor and the particular outgoing spark plug connector don't physically meet, they get close enough that the high voltage causes a reliable arc between the two. So, in other words, everything is ready to go KA-BOOM when the rotor is in the right position.
This all works very well, but it introduces a few nagging problems: The Magnetic fields and the produced Hall Effect must be maintained to the certain level or else the Hall Sensor will not be able to reliably detect and may not pick up the rotors' position properly which can cause dead cylinders or even misfires; the signal will get weaker as the magnet ages. Problems also arise as the other various electrical connections inside the distributor assembly become corroded due to the high voltages arcing between the various contacts inside the cap. Thankfully a cap and rotor set will seldom cost you more then 30USD (and frequently are much, much less then that).
The reason these distributors are so popular is because of reliability and low cost: by using a sensor instead of a physical momentary contact point, friction related wear is almost completely eliminated; and unlike an optical gap distributor, which uses a light sensor, the Hall Sensor distributor can function even when covered in muck and grime.