So, density explains why the solutions stack on top of each other inside the straw, but what keeps the solutions in the straw? You could expect them to just pour out of the straw as you lift the straw from a solution. However, thanks to cohesion (similar molecules attracting each other) and adhesion (different molecules attracting each other), there is surface tension sealing the water at the bottom of the straw. The surface tension is strong enough to help hold the solutions in the straw… as long as air pressure inside the straw is lower than the air pressure outside the straw. Gravity tugs the solutions downward which creates a slight vacuum in the empty part of the straw. That lowers the air pressure inside the straw which is why you need your thumb to cap the straw. This prevents air pressure from equalizing inside the straw. Remove your thumb, air pressure equalizes, and gravity simply moves the colored solutions out.