Aquarium is an artificial ecosystem, which contain fishes as living organisms. In natural ecosytems, other organisms are also present in sufficient number to maintain a balance.
In natural aquatic ecosystem, uneaten food or fish waste turns into ammonia, bacteria then convert these pollutants into non-toxic nitrates. So, If water of aquarium is not changed regularly then wastes could accumulate to dangerous level, that fishes could even die.