The sugar is added at the end of the cooking time as you need to soften the skin of the fruit by cooking before adding the sugar. If added too early the sugar will toughen the skin and you’ll end up with chewy bits all through the chutney. The sugar will also begin to caramelise through the long cooking, affecting the flavour.