The gas stove took the place of the wood burning stove that had to be constantly monitored for temperature control, restocked with wood and cleaned by hauling ashes out and disposing of them. The first gas stoves had a pilot light that constantly burned, and the flame from it ignited the burners. This energy inefficient method was eventually replaced by a spark igniter.
A gas stove also uses electricity to operate. Both the burners and the oven depend upon the spark igniter to create the necessary conditions for the gas to ignite. Natural gas is very flammable and the slightest spark will set it off. When the burner control is in the off position no gas is available to the burner. When the control is turned to "ignite" it releases gas to the burner, and sends a bit of electricity down to the igniter by the burner.
The spark igniter works very similar to the spark plug in a gasoline engine. The electrical current in the igniter jumps across a gap from the igniter to the base of the burner, creating a 15,000 volts direct current (VDC) spark. This very small spark is sufficient to ignite the gas. When the burner is lit, the burner knob is turned away from the igniting position and to the normal temperature control.
Spark igniters fail because of age, or corrosion that eats away at the metal tip. Opening the top of the stove and cleaning the spark igniter is easy to do with most stoves that have unsealed burners. The stove manual should have a diagram that identifies the igniter, but if it doesn't then look for an object close to the burners that looks like a the working tip of a small spark plug. Brush the tip with a toothbrush and rubbing alcohol, being careful not to move any portion of it.
A well working spark igniter produces three to five strong, blue sparks every second. If the sparks are pale and sluggish, clean the plug and burner, and reverse the electrical plug on the wall receptacle. If this doesn't clear the problem up then check the wiring from the burner control to the igniter to ensure it is not cracked or crimped. If the igniter is totally dead then parts are available for almost all models.