In order to understand how it works, we need to examine the two main components of the sealant. The first one is the milk, a white liquid (thats how it got its nickname), contains one or more dissolved rubbers in water. The other component is the sand which is a combination of small particles and fibers. The sand is solid and named like that by its look at the bottom of the bottle.
The idea behind many great inventions is simple and it is also true in this case. Inside the sealed tire the pressure is high (30-100 PSI) while the pressure outside the tire is lower (atmospheric pressure, 14.7 PSI), this differential pressure is the driven force of the sealing system. When a leak occurs because a sharp object (a nail for example) the high air pressure inside the tire pushes the sealant and the air through the hole. When the sealant arrive to the leaking hole the milk and the sand blocks it and seal it permanently.
For the sealant to work properly some conditions need to exist: