"How would the pilot know to turn off its own gas supply?"
On our Suburban stove/oven, there is a safety device 'thermocoupler' on the supply line to the oven burner. The heat from the pilot light keeps the valve open, when the oven is being used or just the pilot on. If there was not a pilot light, or expensive electronic ignition, there wouldn't be any temperature control for the oven.
When you set the oven temp for 350, the burner will heat to 355+/- and then shut off, when temp drops to 345+/- the burner relights from the pilot light to maintain your cooking temp, same at in the oven at home, gas or electric.
If the pilot goes out, the thermocouple closes of all the gas.
On ours, the oven knob has markings for OFF, Pilot, and then the temperature settings 200-400 broil. I usually leave it in the off position, but if I know the oven will be used quite a bit, it's just left in the pilot position, very minimal gas use, minimal heat in the oven, just don't use the oven for storage of flammable items.
Ken