Urea is a small molecule formed as proteins are broken down. It's excreted in urine, but isn't particularly toxic at low levels so it's found in cells throughout the body. The molecular structure of urea is below, and as it contains nitrogen (N) several pathogens have adapted to use it as a nitrogen source using an enzyme called urease to break it down.
The urease converts urea into ammonia and carbamic acid, which then spontaneously reacts with water to form carbonic acid (and produces another ammonia). Converting the carbonic acid into bicarbonate produces a buffer solution: the ammonia and bicarbonate can bond with and dissociate from free hydrogen ions enough to keep the pH of the surrounding area relatively neutral. This is particularly useful for bacteria such as Helicobacter pylori which colonises the stomach and therefore needs to cope with very acidic conditions.
Perhaps unsurprisingly urease is also very important for bacteria that infect the urinary tract such as the Proteus and Klebsiella species. In these bacteria, the carbonic acid and ammonia can bind with minerals such as magnesium and calcium to form "infection stones" - hard coatings that surround and protect the bacteria.
It isn't just bacteria that have learnt this trick, some fungi also contain urease. C. neoformans and Co. posadasii are yeast that infect humans via the lungs and both require the urease enzyme in order to be fully virulent. The ammonia produced by the urease is toxic for human cells and may help the disease to spread into a systemic infection, as has been seen with some bacterial infections.
The pH changes caused by the production of ammonia and carbonic acid may also be useful in helping the fungi evade the human immune system. When the fungi is engulfed by the white blood cells they are trapped within small vesicles called "phagolysosomes" before being destroyed, usually by acids. The ability of the ammonia and carbonic acid to act as a buffer might help to neutralise the acid within the phagolysosomes, preventing the fungi from being broken down. The image below shows a model of how the urease helps the fungi in both the lungs and capillaries - causing tissue damage and preventing the phagocyte (white blood cell) from removing the infection.
Although both fungi and bacteria can contain urease, the enzyme is not present in human cells, making it a potential target for anti-microbial therapies. The urease enzyme contains nickel, which no human enzymes do, and there are a number of accessory proteins involved in delivering and inserting the nickel into the active site of the enzyme. Knocking out any one of these could prevent the enzyme from forming. While this wouldn't kill the bacteria or fungi, it could seriously affect their ability to cause infections.
Reference: Rutherford JC (2014) The Emerging Role of Urease as a General Microbial Virulence Factor. PLoS Pathog 10(5): e1004062. doi:10.1371/journal.ppat.1004062