Cheerio effect
In fluid mechanics, the cheerio effect is the tendency for small wettable floating objects to attract one another.  The comedian and author Rich Hall called this effect "cheeriomagnetization", using it as an example of a word that needed to be coined, or "sniglet". An example of the cheerio effect is the phenomenon whereby breakfast cereal tends to clump together or cling to the sides of a bowl of milk.  It is named for the breakfast cereal Cheerios and is due to surface tension and buoyancy.  The same effect governs the behavior of bubbles on the surface of fizzy drinks.

# Description
The phenomenon of molecules  clumping  applies to anything that floats. This can include a multitude of things, including hair particles in shaving cream and fizzy soda bubbles.

# Explanation
Simple physics dictates that the buoyancy of an object determines whether it submerges in water or is surrounded by air and will sink, float, or remain unchanged. The property of buoyancy  is what keeps a ship floating  and allows balloons to remain in the air. If an object has less density  than the water or air surrounding it, it floats; otherwise it sinks.
The quality of surface tension allows the surface of a liquid to act like a flexible membrane. A variety of weak forces act between liquid molecules to cause this effect.
Most of the water molecules are surrounded by other water molecules in a body of water, such as a simple glass of water. Here they all pull on one another with the effect of pulling them together.  But since these molecules are equal in pulling power, the net effect is zero. Therefore, nothing significant happens.
However where water meets air along the sides of the glass, it gets more interesting.  Water molecules at the surface are pulled forcefully by water molecules beneath them but experience only a weak outward pull from the air molecules above. Therefore, the surface of the water caves in imperceptibly.
Water adjacent to the side of a glass behaves  in a different fashion. It curves either upward or downward, depending on whether the liquid is attracted to or repulsed by the material of the wall.  For water, the curvature is concave since water is drawn to the glass.
Thus, small wettable objects floating on water tend to coalesce into "rafts"; in the case of bubbles, such rafts have many solid-like properties.  Small wettable objects also tend to be attracted towards the edge of the meniscus that may form in a small container.
Writing in the American Journal of Physics, Dominic Vella and L. Mahadevan of Harvard University discuss the cheerios effect and suggest that it may be useful in the study of self assembly of small structures.  They calculate the force between two spheres of density \rho_s and radius R floating distance \ell apart in liquid of density \rho as
2\pi\gamma RB^{5/2}\Sigma^2K_1\left(\frac{\ell}{L_c}\right)
where \gamma is the surface tension, K_1 is a modified Bessel function of the first kind, B=\rho gR^2/\gamma is the Bond number, and
\Sigma=\frac{2\rho_s/\rho-1}{3}-\frac{\cos\theta}{2}+\frac{\cos^3\theta}{6}
is a nondimensional factor in terms of the contact angle \theta.
Here L_C=R/\sqrt{B} is a convenient meniscus length scale.
The cheerio effect also refers to small objects that repel one another. Vella shows that two small floating items with identical wetting properties can repel one another if the relative density of them is of opposite sign.