From foot bacteria to fungal goo, the living things in cheese make it taste wonderful. Veronique Greenwood explores a microscopic world we rarely think about.

Cheese, once primarily a way to extend the useful life of milk, is today quite a darling in the foodie world. It's also fertile territory for adventurous eaters, from Stilton flecked with gold to Sardinian casu marzu writhing with live maggots. Some have even made cheeses with the bugs from their armpits and toes.

But you don't have be a connoisseur to appreciate these living castles of microorganisms. Each one is a house that bacteria and fungi built, and each has its own distinctive architectural style according the tastes of its inhabitants.

The bacterial building begins by mixing milk with lactobacillus or streptococcus to turn it acidic. An added enzyme then snips the tails off the milk proteins. Without their tails, the proteins literally fall out of the milk in solid clumps, grabbing globules of fat as they go. Cheesemakers strain out these clumps, or curds, and press them to prepare a cheese for aging.

It’s during this aging that other microbes can start applying their own distinctive character. Take, for instance, Roquefort, a blue cheese dotted with tiny teal crevices. The builder here is Penicillium roqueforti, a fungus that lives naturally in French caves where true Roquefort cheese is aged, though cheesemakers around the world can add it to fresh cheese themselves to get a similar effect.

P. roqueforti is a sensitive beast. It likes air, but too much oxygen and it will die. So cheesemakers spear the cheese with metal spikes, making small, protected holes where the fungus will be safe to thrive. Once settled in, it manufactures enzymes that slice up the cheese fats into fatty acids, which give it that soapy flavour, and methyl ketones, which give it that particular smell. (Check out this Royal Society of Chemistry article for extra cheese smell nerdery, complete with chemical diagrams.) The fungus produces toxins that cause damage to the heart, lungs, liver, and kidneys when given to mice. But in the habitat of cheese, the substances break down into more harmless forms.

Gooey cheeses with white-rinds, like Camembert, are fungal homes through and through. Penicillium camemberti is a primary inhabitant, setting up shop on the surface and producing enzymes that lead to a chain reaction in the core of the cheese. By digesting lactate, they make the cheese more acidic at the surface than it is in the core, which prompts calcium phosphate ions, formerly well-ensconced in the cheese's structure, to migrate to the surface. The acidity change and the ion movement cause the cheese's innards to liquify. At the surface, more protein digestion yields ammonia, which diffuses into the cheese and gives Camembert its singular whiff. This complex back-and-forth is complemented by a whole zoo of other chemical reactions, which you can read about here in a lovely paper on cheese ripening. A favourite line: “Although by itself methional's boiled potato smell is not particularly pleasant, in combination with other volatiles it is just one note of the cheese aroma of camembert and cheddar.”

Washed rind cheeses like Epoisses or Limburger, which are bathed in saltwater at various points in the aging process, are home to the bacterium Brevibacterium linens. This microbe gives them their extremely funky, “sweaty feet” scent by producing molecules like butanoic acid and isovaleric acid. In fact the microbe is responsible for actual smelly feet, as it lives on skin and works its pungent magic there too. Female Anopheles gambiae mosquitoes are drawn to Limburger's stench, a discovery that garnered its makers a 2006 IgNobel Prize. “Wouldn't it be something, having a simple mosquito trap in one's bedroom baited with a scent that best be described as synthetic human?” begins the Lancet article, which suggests baiting mosquito traps with Limburger. The cheeses that B. linens builds are profoundly stinky, but to the initiated a delicious treat. (For a tour of washed rind cheeses, see this Serious Eats article.)

Gentler ripening processes, with less wild and wooly results, are the rule for Cheddars. These cheeses tend to age just with the starter lactobacillus bacteria they're dosed with at the beginning, without much extra colonisation. But they still have a panoply of scent and flavour molecules combining to produce their singular taste. If you take a whiff of a Cheddar you may notice that the smell is actually very complex. It's savoury, but also a little sweet, salty but also mellow. In fact, talking about cheese is right up there with talking about wine – there's a whole lexicon for professionals. In this 2001 paper, researchers tasted a panel of 240 Cheddars and devised a set of 27 words for describing Cheddar, including: catty, for describing a smell like tom-cat urine, and cowy, for a barnyard tang, along with nutty, brothy, and fruity.

Practical experimentation over centuries has given us the delightful array of cheeses we have today. Science is still picking apart the responsible microbial parties and their habits and talents – often researchers start with a list of molecules in a cheese and a sample of bacteria and must study the second to see how they yield the first. But the more we learn about the details of their goings-on, the more fascinating cheese becomes. When you are next slicing into a castle built by microbes, whether a well-aged round of Camembert or a block of humble Cheddar, consider their contributions.

If you would like to comment on this article, or anything else you have seen on Future, head over to our Facebook or Google+ page, or message us on Twitter.