|MadSci Network: Microbiology|
Although coffee and tea do not contain much for nutrition for us a humans, they do contain carbon compounds and nitrogenous compounds which some fungi can use for food. If you leave a cup of coffee or tea sitting out over time, fungal spores in the air will land on the surface and, if conditions are favorable, the spore will germinate and a colony will start to grow.
More about chemistry of coffee, try Decaffeinating coffee and lectures on coffee.
More about the chemistry of tea try tea talk.
Try the links in the MadSci Library for more information on Microbiology.