Oxygen
Some bacteria are facultative anaerobes, which usually produce ATP by aerobic respiration but are also capable of switching to fermentation when there is a lack of oxygen in their environment.
Facultative anaerobes are organisms that produces adenosine triphosphate (ATP) by aerobic respiration when oxygen is available, but are also capable of switching to fermentation (anaerobic respiration) if oxygen is not available in their environment. Examples of facultative aerobes include; bacteria such as Escherichia coli and Salmonella, and fungi such as Saccharomyces cerevisiae.