What causes icing to solidify?

The icing on a cake is a sugar-based mixture that is usually liquid when applied to the cake, but then solidifies to a hard or semi-hard state as it cools. This solidification is caused by a combination of factors, including:

Evaporation: As the icing cools, the water in the icing mixture evaporates, leaving behind a higher concentration of sugar and other solids. This increased concentration causes the icing to become thicker and more viscous.

Crystallization: The sugar molecules in the icing mixture start to crystallize as the icing cools. These crystals attract water molecules, which further thickens the icing and helps it to solidify.

Cooling: As the icing cools, the molecules in the mixture slow down and lose energy. This reduced molecular motion allows the sugar crystals to form more easily, leading to a solid structure.