When it's crank is rotated, the Wimshurst machine separates electric charges by electrostatic induction, which creates a large potential difference across the two metal spheres which are separated by a few cm of air (this is called a spark gap). When the electric field exceeds some threshold value, the air undergoes dielectric breakdown and becomes a conductive plasma, allowing a spark to jump between the two metal spheres. For air at sea level, an electric field of around 30,000 V/cm is required for ionization. The spark is visible as excited electrons release photons when returning to their ground state. The snapping sound is caused by the rapid expansion of heating air. This is how spark plugs work.
Adding a flame between the two electrodes significantly lowers the breakdown voltage required to generate a spark.