With time, particulate like dust and dirt will pile up around your spark plug. This should be cleaned off to improve performance, and WD-40 is a great way to do so.
The WD is short for Water Displacement, which means it pushes the water out of the way. If your spark plug is wet or if there is liquid around the igniter, WD-40 can be used as part of your cleaning routine to remove moisture. It also removes built-up carbon residue from the electrode.
Using WD-40 regularly can prevent moisture from corroding the mechanical parts of the motor, including the spark plug. It will also chew through corroded or rusted metal, which is useful if your spark plug is stuck and difficult to take in and out.