A gas stove burner can get hot even when the knob is not turned on due to a phenomenon called "pilot light" or "standing pilot." Many older gas stoves and some newer models are equipped with a small, continuously burning flame known as a pilot light.
The pilot light serves as an ignition source for the gas burner. When the gas valve is turned on, the gas flows through the burner and is ignited by the pilot light, resulting in a steady flame. However, even when the main gas valve is turned off, the pilot light continues to burn.
The pilot light is usually located near the burner, and its flame can generate enough heat to warm up the surrounding area, including the burner itself. This is why you may feel heat near the burner, even if the knob is not turned on.
The purpose of the pilot light is to provide a constant flame for relighting the burner quickly when the gas is turned on. It helps ensure that the stove is ready to ignite the gas and start heating the burner immediately when you turn the knob.
It's worth noting that newer gas stoves often come with electronic ignition systems, such as spark ignition or glow ignition, which do not require a pilot light. These systems provide a spark or heat to ignite the gas when the knob is turned on, eliminating the need for a continuously burning flame. In such stoves, you would not experience heat from the burner when the knob is in the off position.