some times a car turns it self off for a safety reasons if your on a hill and needing to close the fuel supply and sometimes its so fuel economy is increased...
I've seen this happen due to several causes. Strong winds can shake the car enough, parking on a slope, heat, the panic button getting pushed by a key in your pocket. Also, a weak battery, corroded...