Note: They don't actually make the oxygen. It already exists. Two atoms of oxygen are bonded with a carbon atom to make the carbon dioxide molecule which animals breathe out. Trees and plants breathe it in, keep the carbon for themselves, and breathe out the oxygen.
Salil91