Wine , vinegar, cheese, pickles-- all of these food are made with 'controlled spoilage'-- a bacteria or small plant 'infects the food', changes it, and in the process, makes it an enviroment that is hostile to most other bacteria.

in grape juice, yeast that grows on the skin of the grapes changes the sugar (in the grape juice) into alcohol--eventually there is so much alcohol (12 to 14%) that even the yeast is killed.. and the resulting liquid is pretty stable.. very few bacteria (harmless or harmful!) can live in the alcohol...

of course one can--and it turns the alcohol into an acid-- which is another enviroment that most bacteria can't survive in! and voila--vinegar!--the high acidity make vinegar almost 'spoil proof'--almost no bacteria or other living organizism can live in such a high acid environment--so its natural 'sterile'--

the combo of salt and lactic acid (created by the controlled spoilage of food) is what makes 'pickles pickle'--and the high salt/acid combo preserves the food since it too is a environment that very few bacteria can survive in.

man has interacted with these helpful bacteria for eons.. sometime recognizing them, sometimes not... there is an fungus that sometimes effects grapes-- its called the 'Noble Rot'-- you don't eat the 'fruit of the fungus' (mushrooms) but the fungus changes the fruit acids of the grape, and the result is a very sweet wine.

while you can purchase wine made from 'noble rot grapes' in US-- you can't use grapes with noble rot in US to ferment wine... the grapes are deemed 'unfit for human consumption' by FDA/Dof A-and you are supposed to destroy the crop!

same is somewhat true of 'corn smut' a fungus that grows on the ears of the corn.. native americans consider it a treat, and the mushrooms from corn smut (a kind of puffball, that when fully ripe, explodes in a cloud of fine back spores)to be a deleciacy, but farmers see it as a 'spoiled crop' and very few european american eat 'corn smut'(even the name sound unappatizing!)

with cheap readily available refridgeration, we rarely think about 'natural' ways of preserving foods anymore.. and preserving food was done by storing them in naturally
sterile environments
in the past.