These fires were subterranean gases that escaped to the surface. A few of these gas leaks caused fire which many believe it to be connected to the appearance of Zoroastrianism in Azerbaijan about 2,000 years ago (azerbaijan.travel, n.d.).
Fun fact: Did you know that Azerbaijan is the 24th largest crude oil producer in the world in 2018 and is second among EU4Energy focus countries after Kazakhstan?