Sugar is added to jam to preserve it. How does it work?
Sugar is added when you make jams and preserves. Why should this work?
It works because the concentration of sugar is so high in the preserve that it would leach water out of any micro-organism. Heavily salted hams and bacon work by this same principle.
Of course, your jam can go off, but while it is sealed, jam has a very long shelf life. This is a good thing, of course, because when you harvest your oranges you can make jam from the surplus, and have marmalede on toast throughout the year (along with your bacon, and eggs if the chooks are laying!).
PS The history of orange marmalede is very interesting, and is worth looking up!