Oxygen is produced by plants and green-blue algae and consumed by weathering and burning. And yes, also by animals breathing, but that's actually pretty marginal. Oxygen levels are far from constant. There is evidence that in the last 500 million years it fluctuated between 15% and 30% percent.
Hope this helped!