Why it happens
Making caramel means dissolving sugar into a syrup and then heating it until it caramelises. A sugar syrup is unstable, and a stray crystal can set off a chain reaction where the rest of the sugar crystallises around it. This is called crystallisation. Stirring, sugar crystals stuck to the sides of the pan, or bits of dust or undissolved sugar can all start it off. Acids such as lemon juice, and ingredients such as golden syrup or glucose syrup, help stop sugar from crystallising.