Gosh. You want to know everything? What fun is that?
A couple wires are there to power the unit's electronics. One's on a resistor wire to keep voltage within acceptable range.
Another pair picks up the signal from the distributor's pickup.
Ground wire from coil.
Pulse from pickup to electronics -> grounds the coil. Coil secondary voltage releases through the spark plug. Boom.