A magneto is an electrical component upon which the ignition coil and lighting coil are located. The ignition coil provides pulses of electrical power to the spark plug in most mopeds. As no battery or other source of energy is required, the magneto is a self-contained solution to providing ignition and lighting.
Inside most magnetos, the engine rotates permanent magnets around coils of wire to provide a basic source of electrical energy. On each revolution, a cam opens the contact breaker points, interrupting the electrical current, causing the voltage in the ignition coil to reach a very high value, enough to arc across the electrodes of the spark plug. A condenser is wired from the points to a ground to prevent the points from arcing when they open.
Most moped magnetos also contain separate coils for providing electrical current for a lighting system.
In some modern magneto designs, an electronic switch (CDI ignition) replaces the points.
chart of ignitions & wiring http://www.mopedarmy.com/forums/file.php/6/88082/Magneto-Wires-Chart1-591x800.jpg