This question was asked by Mary from East Sussex, UK.
Humans have used sugar to preserve food for thousands of years, though originally honey would have been used rather than sugar in the form we’re familiar with today. When we talk about preserving food we mean stopping it going rotten, or at least delaying the process for a significant period of time. In fact this is why jams and marmalades are commonly called preserves – because they use sugar to preserve fruit that would ordinarily go bad within days or weeks of being picked.
Sugar is able to delay this process because it attempts to match the sugar content of the foodstuff in question. Water is drawn away from the food and replaced with sugar; this makes the food an inhospitable environment for the bacteria and microbes that would usually cause it to decay. Sugar can also be indirectly responsible for preservation because it speeds up the production of antimicrobial substances by other organisms. A good example of this is the way sugar feeds the yeast in bread, beer or wine; because the yeast consumes the sugar it’s able to make more of the substances that kill off microbes.
Interestingly, salt works in the same way and has also been used to preserve food for thousands of years; the only difference is that salt is used to preserve savoury foods, particularly meat and fish. Of course, nature always finds a way, and there is an entire class of bacteria called halophiles that require a large amount of salt in order to grow and are able to spoil salt-preserved foods. Equally there are some sugar-loving yeasts and microbes that are capable of spoiling food that has been preserved with sugar.