I think you're asking about the gunk leftover in a cup of tea or coffee after the drink is gone. And you're right, it always seems to form a ring around the edge of the cup and doesn't just settle down uniformly across the bottom of the cup. A scientist in Japan studied this very phenomenon. He found that when the water in the hot drink is very hot there is heat convection -- the hot water tends to rise in the middle of the cup (hot water is less dense than cold water) and the cooler water at the very top of the cup (cooler because it's exposed to the air) tends to sink toward the edges of the cup. As the hot water rises in the middle of the cup, it pushes the small tea or coffee particles upwards. As the cooler water then sinks toward the edges of the cup, it drags down those particles, leaving them in a ring at the outer edge of the bottom of the cup.