The main nitrogen product of metabolism is ammonia (NH3), which is toxic.
Aquatic animals excrete ammonia directly into large amounts water.
Mammals use energy to convert ammonia to the less toxic urea, which is excreted in urine.
Birds and insect convert the ammonia to uric acid, which requires even more energy to produce, but is insoluble in water and can be excreted as a paste with little water loss.