Theres usually a thermocouple that sits in the flame,and is normally mounted to the burner.It thinks the gas to the burner isn't lit,so it shuts the gas off.
paul, January 2012
edit
I can answer this question...
my grill will not stay lit when you let go of the control knob even after k?