This process of converting ammonia into nitrate is called nitrification. The main source of ammonia in koi ponds is fish metabolism. Metabolism is a general term covering all the various processes taking place in living organisms, such as food digestion, energy production, tissue repair and cell growth. Any surplus is stored as body fat or excreted as waste. Excess amino acids cannot be stored and end up being converted to ammonia in a process called deamination and then excreted into the water via the gills.
Any undigested food is passed out with the faeces.
This process is not exclusive to fish, indeed all animals produce metabolic ammonia. However, in most animals ammonia is immediately converted into a less toxic substance, usually urea, and excreted in the urine. Koi, being voracious eaters, produce large amounts of ammonia and may be considered as ammonia factories, converting expensive fish food into ammonia and other wastes. The amount of ammonia produced is directly related to the amount of food given each day, which of course depends on the stocking level and size of fish. Further sources of ammonia are decomposing fish wastes, undigested fish food and other organic matter.