Oxygen is essential for fish survival. When oxygen supply is not enough, the fish can have low appetite, swim less vigorously and have labored breathing shown by the rapid movement of gills If you see your fish going to the surface and gasping repeatedly with its mouth open wide, it is a sign that oxygen supply is insufficient.
Besides fish needing oxygen supply, other living things in the aquarium also need it. Beneficial bacteria need oxygen to break down waste. The plants that grow there also need oxygen. Basically, everything that lives and eventually decays or dies off in your aquarium requires oxygen, and therefore depletes it in the process of consumption.