Nitrates
A nitrate is a salt of nitric acid with an ion composed of one nitrogen and three oxygen atoms (NO3−).
In freshwater systems close to land, nitrate can reach high levels that can potentially cause the death of fish. While nitrate is much less toxic than ammonia or nitrite, levels over 30 ppm of nitrate can inhibit growth, impair the immune system and cause stress to some aquatic species. In most cases of excess nitrate concentrations in aquatic systems, the primary source is surface runoff from agricultural or landscaped areas which have received excess nitrate fertilizer. These levels of nitrate can also lead to algae blooms.
Ammonia
Ammonia is produced mainly by fish respiration and urine, but also by fish waste and decaying matter. (fish food, dying plants, dead fish, dying live rock, etc.)
An increase in fish population can also trigger ammonia spikes, as well as untreated tap water .The use of antibiotics sometimes kills off bacteria colonies. Massive cleaning or a power outage can also have the same effects on the bacterial colonies.
When testing your water for ammonia levels make sure the test kit hasn't expired and that it has been stored properly. Further, ammonia removing products often result in wrong readings indicating high ammonia levels (if the fish are fine, don’t panic). A new tank will not cycle if ammonia-binding products are used because ammonia is required to establish beneficial bacteria colonies.
After a tank has cycled ammonia readings should be undetectable at all times. Ammonia is extremely deadly for your aquarium fish.