Most nonpermanent markers use inks that are made of colored pigments and water. On a coffee filter, the water in the ink carries the pigment onto the paper. When the ink dries, the pigment remains on the paper.
When you dip the paper in water, the dried pigments dissolve. As the water travels up the paper, it carries the pigments along with it. Different-colored pigments are carried along at different rates; some travel farther and faster than others. How fast each pigment travels depends on the size of the pigment molecule and on how strongly the pigment is attracted to the paper. Since the water carries the different pigments at different rates, the black ink separates to reveal the colors that were mixed to make it.
Chromatography is one of the most valuable techniques biochemists have for separating mixtures. It can be used to determine the ingredients that make up a particular flavor or scent, to analyze the components of pollutants, to find traces of drugs in urine, and to separate blood proteins in various species of animals (a technique that's used to determine evolutionary relationships).