Nitrogen compounds are building blocks of life, all living organism need them, use them, and excrete them. Some of these nitrogen compounds are poisonous to specific groups of living species but may be a food article for another group of living species. In the aquarium ammonia NH3, is a nitrogen compound which although food for plants, algae and certain bacteria is poison for fishes. This ammonia in the aquarium is produced from the excretions of fishes and also from breakdown of organic matters like uneaten food, dead leaves, feces, urinary compounds, etc.
For the safety of the fish the ammonia must be somehow absorbed and converted into a non-poisonous compound. Unless this can be done fish will die, this often happens in a newly setup aquarium and is given the name 'new tank syndrome'.
There are types of bacteria which can convert ammonia into nitrite, NO2. These bacteria can live in the water and attaches itself on surface of solids like the gravel, leaves, glass and also filter media etc. The amount of ammonia that these bacteria can convert depends upon their population, in a new aquarium the population of these bacteria is too small for them to be able to handle the ammonia produced by even one fish.
Again nitrite, NO2, that these bacteria convert ammonia to, is also poisonous to fish, although much less poisonous than ammonia. We need another group of bacteria which converts nitrite into nitrate, NO3, a compound which is even less poisonous to fish. Again the population of these bacteria is too small in a new aquarium.
Building up the population of these bacteria in a new aquarium is called 'cycling the aquarium'. When the population of the bacteria has become large enough to quickly convert large amounts of ammonia into nitrate, NO3, we have a cycled aquarium which is ready to take fishes and keep them safe from poisonous ammonia and nitrite.
From this point on you can have fishes in your aquarium, but you have to keep them safe from nitrate, NO3. Aquarium plants will help you, for they will absorb nitrates for their own use, but still unless the plants are growing vigorously, you have to help in keeping the nitrates down by doing routine water changes. The normal routine is changing 25% of the aquarium water each week.