A biofilm is a collection of microscopic organisms which have chosen to attach themselves to each other in the interests of survival. Biofilms can be found all over the world; you are hosting a few yourself, in fact, in the lining of your intestine and on your teeth. Biofilms are also responsible for that weird gunk in your pipes, the slippery rocks in a river, and the streaks of algae you sometimes see on a pond. These aggregations of organisms play a number of unique and interesting roles in many corners of the Earth.
A biofilm is characterized by the sticky adhesive substance which members of the colony secrete. This substance becomes a supportive matrix, pulling the colonists together and protecting them from the outside world. It also works to attract more organisms to the biofilm as it grows, providing numerous appealing anchoring points for these organisms so that they can settle down.
Biofilms tend to thrive in moist environments. They can form either on a hard substrate, like a tooth, or they can form at the boundary between air and water, like the algae which float on ponds and lakes. The formation of a biofilm starts with just a few colonists who attach to the substrate and start to anchor themselves. If these colonists are left undisturbed, others will join them, causing the biofilm to quickly grow. The bacteria in the biofilm can actually communicate with each other using complex molecules, making decisions as a group as they respond to their environment, and at a certain point, the biofilm will break open and disperse, sending colonists to new regions, although a small deposit is usually left behind.
Depending on where a biofilm forms and which organisms are in it, it can be good or bad news. Biofilms are used to clean up oil spills, for example, with scientists releasing colonies of organisms which feed on hydrocarbons. They are also responsible for foodborne illness, as they like to colonize counters and floors. Biofilms can also act as reservoirs for harmful bacteria in hospitals and clinics, which is why these spaces are frequently and rigorously cleaned.
Other biofilms make interesting topics of scientific inquiry. For example, biofilms can be found in the ferociously hot and chemical-saturated waters of hot springs, an environment which scientists previously thought was uninhabitable, and they also lurk in the extremely deep waters near hydrothermal vents. The biofilm is also likely responsible for life on Earth as we know it, as collections of organisms known as stromatolites are probably the source of much of the world's oxygen.