Metabolic processes produce waste, and a great deal of this is in the form of NITROGEN

Nitrogen combines with other molecules in the body to produce toxic compounds such as ammonia

And so the animal must find a way to excrete these toxins. As we already know, this is the function of the kidneys and the rest of the renal system.

Ammonia has only one nitrogen per molecule, but it is quite toxic. It requires a great deal of water to be flushed out of the body. Animals such as fish and amphibians, which have constant access to water, have not suffered natural selection that led to more "water conservative" measures, and flush their nitrogenous waste primarily as ammonia.

Terrestrial animals, however, because they have less access to water, have been under selective pressure to

Mammals metabolize ammonia into a molecule called urea:

As you can see, this molecule contains two atoms of nitrogen. Although it requires metabolic energy to build, it also is less toxic than ammonia, and it requires less water to flush from the system. Your urine's main nitrogenous waste product is urea.

Reptiles (including birds) go one step further, packaging their nitrogenous waste as uric acid:

...which contains FOUR nitrogen atoms per molecule. It requires more metabolic energy to make than urea, but it also eliminates more nitrogen per molecule and, is quite non-toxic, and requires very little water to flush from the body.

The white, crystalline substance you see in a typical bird or lizard "poop" is actually urine: a little pool of uric acid crystals in a very small amount of water.

So there are three general ways that vertebrates rid their bodies of nitrogenous waste:

The evolutionary history and natural selective pressure of any given taxon of vertebrates contributes to which method the animals use. Which environments would you suspect to exert selective pressure for each of the three types of excretion above?