Mysterious CDI

so it has a capacitor that stores a charge (spark) then sends the spark to the coil and the coil sends it to the plug?
 
Think of a coil as a storm cloud. It builds up a lot of voltage till something triggers it to release all that voltage. The CDI is that trigger and the fly wheel tells the CDI when to trigger it.
 
In a CDI system, a charging circuit charges a high voltage capacitor, and at the instant of ignition the system stops charging the capacitor, allowing the capacitor to discharge its output to the ignition coil before reaching the spark plug.

A typical CDI module consists of a small transformer, a charging circuit, a triggering circuit and a main capacitor. First, the system voltage is raised up to 250 to 600 volts by a power supply inside the CDI module. Then, the electric current flows to the charging circuit and charges the capacitor. The rectifier inside the charging circuit prevents capacitor discharge before the moment of ignition. When the triggering circuit receives triggering signals, the triggering circuit stops the operation of the charging circuit, allowing the capacitor to discharge its output rapidly to the low inductance ignition coil. In a CD ignition, the ignition coil acts as a pulse transformer rather than an energy storage medium as it does in an inductive system. The voltage output to the spark plugs is purely dependent on the design of the CD ignition. Voltages exceeding the insulation capabilities of existing ignition components can lead to early failure of those components. Most CD ignitions are made to give very high output voltages, but this is not always beneficial. When there's no triggering signal, the charging circuit is re-connected to charge the capacitor.