I should probably know this but I didn’t, so I did some research.
It seems that the active ingredient that does the sealing is the latex. In the sealant this is a liquid and it turns to a solid to seal a hole.
Actually, the liquid is a dispersion of small particles of solid latex mixed (not dissolved, it’s a bit different) with water. As the water evaporates, the small particles coalesce (join together) and form a solid lump.
A small amount of ammonia (which is alkaline, and thus prevents the liquid from becoming acidic) is usually added to the liquid to stop it solidifying too easily, I expect this affects the bonding in the liquid dispersion and makes all the tiny solid latex particles repel each other, which stops them sticking together into clumps prematurely.
And when you get a puncture, you’re relying on the small particles of latex being forced together by the bottleneck and coagulating to form a solid plug. Possibly this is accelerated by the drop in pressure from inside to outside the tyre. I expect you need a lump big enough for other bits to stick to it, until the entire hole is covered.
I should add that this is different to how paint works. They use a solvent (‘VOC’) to dissolve a solid (pigment) and make a liquid paint. As the solvent evaporates (that’s why paints smell strongly) the solid comes out of solution and is a solid again. Paint = liquid. Stans = dispersion of solid latex in liquid.
HTH.