Algae is a plant. All aquatic plants grow by photosynthesis which is the process they use to make glucose (sugars) that is stored and used as a food source for energy to grow new leaves and flower/reproduce. Photosynthesis requires light and 17 chemical elements as nutrients. The nutrients include carbon dioxide (CO2), nitrogen, and other macro-nutrients and micro-nutrients. The rate of photosynthesis is affected by light, temperature, CO2 levels, and nutrients. [References for more detail: Peter Hiscock, Encyclopedia of Aquarium Plants
; Diana Walstad, Ecology of the Planted Aquarium
Plants, including algae, use nutrients. In a well-planted aquarium, plants are able to outcompete the algae for nutrients. One of the essential nutrients is nitrogen, and plants can use ammonium (NH4+), nitrite (NO2-) or nitrate (NO3-) as their nitrogen source. Most aquatic plants, including algae, have been found to substantially prefer ammonium over nitrates [Walstad, ibid
., p. 107] especially to produce their proteins [Walstad, ibid
., p. 111]. In acidic water, ammonia (which is highly toxic to all fish and plants) changes into the less-toxic form ammonium, and the plants grab it. In basic (alkaline) water the plants either convert ammonia to ammonium through the cell structure of their leaves, or they use it to synthesize proteins. Plants are so effecient at grabbing the ammonia/ammonium they out-compete the nitrosomonas bacteria. This is because it requires less energy for plants to directly use the ammonium or convert the ammonia than it does for plants to use the nitrates resulting from the nitrification cycle of bacteria and convert them back to ammonium. Plants are also believed to be capable of using nitrite as a source of ammonium, and again in preference to nitrate [Walstad, ibid
., p. 22-23]. This explains why in a planted aquarium nitrate levels are always low, unless something occurs to destroy the biological balance.
It is no surprise that in a non-planted aquarium, algae is much more of a problem than in a planted aquarium. The nutrients that come from the fish, fish food, water, and biological and bacterial processes are readily available for algae without competing plants. Light is also required for algae; diatoms (brown algae) will occur under low light, green algae under bright light. In a well-planted aquarium where everything is in balance, algae is never a problem; it only becomes one when something is done to upset the balance.