Spill a drop of coffee and let it dry. You don't get a flat brown disc. You get a dark ring, sharp at the edge and pale in the middle. The pigment was spread evenly through the drop, so something carried it outward.

The edge is stuck

A drop on a table has an edge, the contact line, where liquid meets surface. On a rough or dirty surface that edge tends to get pinned. As water evaporates, the drop would normally shrink inwards. Pinning stops that, so the edge stays put while the drop gets flatter.

Evaporation is fastest at the rim

The thin rim loses water faster than the thick middle. Water has to be replaced there, so liquid flows from the centre toward the edge, carrying coffee particles with it. This is the explanation published by Robert Deegan and colleagues in Nature in 1997. The particles get dumped at the pinned edge, and the ring builds up.

Try it

Side view. Arrows show the flow. Slide pinning down to let the edge retreat, and the particles stop piling up at one place.

Ways to break the ring

If the edge is not pinned, it slides inwards with the drop and the particles are dragged into a small dot instead. That is why the same ink can leave a ring on one surface and a spot on another.

Stretched, egg-shaped particles also help. In 2011 Peter Yunker and colleagues reported in Nature that ellipsoidal particles do not make a sharp ring, while spheres do. The elongated particles get trapped at the water surface and jam together there, which stops them reaching the rim in a neat line. Adding a second liquid that sets up a surface-tension flow back towards the middle is another known fix.

Why anyone cares

Inkjet printing, paint and coatings all rely on drying droplets. A ring means uneven lines and patchy films, so engineers work hard to suppress it. In the other direction, the effect can be used to line particles up on purpose.

So the ring isn't the coffee settling or darkening. It is the drop's own flow, pushing everything dissolved in it to the one place it can't leave.