Earth is the only planet in the solar system to have oxygen.
The first plants began to form about 3billion years ago. They were microscopic algae that formed in the sea. They contained chlorophyll and started producing oxygen. before this no oxygen existed on Earth.
Over time more plants grew which produced more oxygen and they covered the earth.
Plants release oxygen during the process of photosynthesis.