The thermocouple.
A thermocouple produce’s temperature dependent voltage as a result of the thermoelectric effect, and that’s the boring bit out of the way.
In a gas oven or gas cooktop thermocouples are used as safety devices, one end is in the flame the other connected to the gas valve via a solenoid and if your flame goes out the thermocouple cools down and shuts your gas off. Brilliant you say, however they are a serviceable item and are required to be replaced from time to time ( a bit like a clutch in a car), when a thermocouple fails more often than not you will be able to ignite a burner however the flame will go out when you release the knob.