The model of heating sugar to form a liquid and then cooling it to create a hard-crystalline substance best models the formation of igneous rocks.
Igneous rocks are formed from the cooling and solidification of molten rock material (magma or lava). Just as the sugar melts and then crystallizes upon cooling, molten rock cools and crystallizes to form igneous rocks.