Oxygen existed before oxygen-rich air
The first oxygen made on Earth did not simply collect in the atmosphere. Other gases and minerals reacted with it and used it up. Oxygen began building in the air only after production became greater than these chemical sinks.