Most piston-powered helicopters have dual magnetos so that if one magneto fails in flight, the engine will still operate.
Magnetos provide the spark needed for the ignition system by generating their own electricity. Magnetos do not need the electrical system active to work. For safety, there is built in redundancy. During the preflight, one magneto should be turned off and the engine should still run. Then, the other magneto should be tested. Both magnetos should be operational and on during flight. In addition to safety, the dual magnetos provide some additional performance benefits. When one magneto is disabled, the RPMs will decline some.
In addition to checking before flight, magnetos operation should be confirmed before maximum performance takeoffs, where an engine failure would be extremely hazardous.
There are some helicopters that have one or more electronic ignition system instead of a magneto. However, the redundancy principle still remains.
FAA-H-8083-25B Pilot’s Handbook of Aeronautical Knowledge pg. 7-15