When you feed your fish they produce waste matter. This decomposes to create poisonous Ammonia. The filter then breaks down the Ammonia which turns it into Nitrite (this is also poisonous to fish). The Nitrobacter Bacteria breaks down the Nitrite into Nitrate which is safer for fish. Some of the nitrate goes back into the tank and is used as food by the plants and algae (which in turn produces more waster matter in the form of dead plant material). The rest of the Nitrate is reduced when the tanks water is changed. The nitrogen cycle (also known as cycling, biological cycle, startup cycle and nitrification), is an intricate process and can be difficult to get the balance right.