Cellular respiration releases the energy of glucose in small steps and stores it as ATP. It begins with glycolysis in the cytosol, which splits glucose into two molecules of pyruvic acid. Glycolysis needs no oxygen.
With oxygen, pyruvic acid enters the mitochondrion. It is oxidised to acetyl CoA, which enters the Krebs cycle in the matrix. The cycle releases CO2 and loads hydrogen onto NAD+ and FAD. The respiratory chain on the inner membrane passes the electrons to oxygen, forming water, and most of the ATP is made here.
Without oxygen, pyruvic acid is reduced in the cytosol instead. This remakes NAD+ so that glycolysis can continue, but only 2 ATP are gained per glucose.