The answer is partly to the interface and partly to each other. If you look closely at the surface of a pond you will see this biofilm even with the naked eye. It is a widely held view that the world is teeming with microbes. While this is generally true, they are not as evenly distributed throughout the world as you might think. Take the air, for example.
Few microbes have a truely free-roaming lifestyle, they much prefer to stick to a surface.
The benefits of attachment Sticking to a surface has very real benefits for many microorganisms. First , there are very few habitats that don't contain at least one surface and by sticking to it, a microbe can manage to physically stay in it's chosen environment for which, we must presume, it has become adapted. It doesn't matter if the nutrient is organic or inorganic, the laws of physics dictate that molecules tend to adsorb to interfaces and interfaces are surfaces. This means that in any environment the concentration of any particular molecule is very likely to be higher on, or in close proximity to, a surface. Third, different species of microbes often act together to exploit a habitat.