The phlogiston theory was put forward in 1667 by Johann Joachim Becher as an attempt to explain the combustion process and the rusting of metals both of which are now known as oxidation. Becher suggested that there was the existence of a fire-like element called phlogiston which was contained within flammable or combustible substances that were released during combustion.
The Phlogiston theory said that all flammable substances had phlogiston within them. It was something that did not have any colour, smell, taste or mass that was released upon burning. After everything was burned, only then would the dephlogisticated, substance would take its true form. For instance substances that could be burned in air were determined to be rich in phlogiston. When air was taken away, burning would cease leading to a conclusion that air had a capacity to absorb a finite amount of phlogiston.
This theory didn’t survive for very long.
Chemists were beginning to conduct quantitative experiments and taking measurements. It was observed that some metals gained weight after being burnt, magnesium being one of them. If phlogiston had been released during the burning process, why was there a gain in weight? If anything the weight should have decreased on the release of phlogiston, or perhaps remained the same given that phlogiston was supposed to not have any mass.
Phlogiston Theory survived as the dominant theory until Antoine-Laurent Lavoisier demonstrated that combustion requires a gas with a measurable weight to occur. This gas was oxygen. He used closed vessels to make these measurements and his findings started the caloric theory of combustion.