The substrate in an aquarium is an area where waste products are collected and broken down by bacteria, for planted tanks this is a beneficial process as it helps to release and store nutrients. If there is a large amount of waste or organic material and a limited flow of water, some areas of the substrate can become anaerobic (lacking in oxygen)
When this happens in significant portions of the substrate, the anaerobic bacteria which grow under such conditions will release toxins into the water such as hydrogen sulphide, which can be toxic to plants and fish.
Anaerobic substrate can also rot the roots of aquarium plants if the plant is unable to release oxygen to the area around its roots.
For planted tanks, it is actually beneficial to have small patches of anaerobic substrate because these small areas will prevent nutrients from becoming oxidised and unusable, acting as 'storage areas' for the plants. The ideal is to have a substrate that has small patches of anaerobic areas or overall low oxygen content but does not become largely anaerobic and toxic.
This fine balance can be achieved by choosing the right size substrates, which in turn dictates the amount of water flow through the substrate, and the amount of oxygen available.
Substrates such as silver sand are very fine and compact easily, stopping water flow and becoming anaerobic - this can be seen when the sand turns black. When sand is used in the aquarium it must be gently stirred on a weekly basis to avoid toxic areas occurring.
Some planted tanks incorporate heating cables that create a current of water through the substrate so that stirring is not required.
On the other end of the scale, very large substrates allow plenty of oxygen-carrying water to pass through, preventing anaerobic areas but removing nutrients in the process. Regular gravel cleaning to reduce the amount of debris in the substrate will help to prevent the chance of substrate becoming anaerobic