The purpose of a filtration system in a closed system such as a pond is to emulate as closely as possible the natural nitrogen cycle of nature.
Fish eat food and create waste.
Debris falls into the pond and decomposes. These dissolved waste products, primarily ammonia , meet nitrifying bacteria in the biofilter and are digested, creating their own waste products. Nitrates are far less toxic to the fish population than the original ammonia waste product. In the natural world , a myriad of other bacteria and countless other microbes would digest this nitrate waste product and therefore consume this nitrogenous waste. Plants, also use nitrates as a nutrient source.