The microscopic mechanism behind the extraordinary ability of ceria to store, release, and transport oxygen is explained on the basis of first-principles quantum mechanical simulations. The oxygen-vacancy formation energy in ceria is calculated for different local environments. The reversible CeO2-Ce2O3 reduction transition associated with oxygen-vacancy formation and migration is shown to be directly coupled with the quantum process of electron localization.