The primary function of mitochondria is oxidative phosphorylation, a process that generates ATP through the electron transport chain and chemiosmosis. During this process, electrons are transferred from electron donors to electron acceptors such as oxygen, in redox reactions. These reactions release energy, which is used to form ATP. The Krebs cycle, or citric acid cycle, also takes place in the mitochondrial matrix and is a key part of cellular respiration, contributing to the production of electron carriers NADH and FADH2.