Two facts decide almost every case, and neither is about gas
Almost every guide opens with the same sentence: the battery is flat, change it. That advice costs a few pounds and, more importantly, it costs you the diagnosis — because the ignition circuit tells you whether it has power before you touch anything. Press the knob and listen. A rapid ticking means the cell is delivering, the spark generator is oscillating and the micro-switch under the knob has closed. All three of those are in series, so a click rules out all three at once. Silence is the only result that points at the battery, and even then the cell is often fine and the contacts are not.
The second fact is about geometry. The ignition pin is a metal spike in a ceramic sleeve, and the spark is a high-voltage discharge finding the shortest path to earth. Where that path goes is the whole question. It is supposed to jump 3–4 mm into the gas stream just outside a burner port, because that is the only place where the spark meets something that will burn. Carbon on the tip, grease on the ceramic, a pin bent by a pan, or a cap that is not seated into its locating pin — any of those moves the shortest path somewhere else. The spark still looks impressive. It is now jumping to solid metal with no gas on it, which is exactly as useful as tinder that will not strike.
The third fact is the one that catches people, and it is not a fault at all in the usual sense. A hob has a flame-supervision probe — a thermocouple — sitting in the flame. Heated, it produces roughly 20–30 millivolts, and that small voltage is what holds the gas valve open. No flame, no millivolts, valve closes within seconds. That design is why a hob can never leak gas into a room after the flame blows out. It is also why you have to hold the knob for three to five seconds on a cold start: the probe has to heat up before the valve will latch. A hob that dies the moment you release is not failing to ignite. It is igniting, and then being switched off by a safety device that never got warm enough.
Three faults, three answers
Dead silent is the electrical end. One D cell in a plastic box, usually under the hob or behind the front panel, and it is a carbon-zinc cell working in a hot greasy place — six months to a year is normal. But before you buy one, look at the contacts: leaked electrolyte leaves a white-green crust that keeps the voltage and destroys the current. Scrape it off with a knife point, and a surprising number of silent hobs come back to life on the old cell.
Clicks, but the spark is in the wrong place is mechanical, and it is free. Watch where the spark lands while you press. It belongs just beside a port on the cap. If it is crawling over the cap face or jumping to the trivet, clean the tip with a toothbrush, then bend the pin back so it points at a port, and reseat the cap until it drops into its notch. The gap wants to be about the thickness of a coin — too close and the spark is weak and easily shorted by carbon, too far and the voltage will not jump at all.
Lights, then dies on release is the probe, and the test is your finger. Hold the knob down for five full seconds, then let go. If it stays lit, the probe is being heated and the problem is your technique, not the hob. If it still dies, look at the probe: is the flame actually wrapping around its tip, or is the flame sitting off to one side because a port is blocked or the cap is on crooked? A probe that never gets hot cannot hold the valve, and no amount of holding the knob longer will change that — it is not a timer, it is a thermometer.