They give us oxygen because they receive their energy from the sun. This solar energy gets converted into chemical energy which releases oxygen. Thanks to this process of photosynthesis, other creatures like us, who need oxygen can survive.
So you see through the plants we indirectly receive energy from the sun. Isn’t it fascinating, another wonder of God’s artistry.
Affectionately,
Alok Da