Dyes and pigments are used to color substances, but there are differences in their properties.
Simply put, this difference is whether or not they are soluble in water and whether or not this causes a decrease in bonding.
That is why dyes are often used to color fibers, while pigments are often used in architecture and paintings.
Because of the large particle size of pigments, they do not dissolve in water. They do not bond directly with the thing they color, so they lose their color over time.
Since dyes are soluble in water, they penetrate the molecules of the fiber and bond with the fiber molecules (either through ionic bonding or covalent bonding). So once the color is attached, this is not easily removed. Of course, there are exceptions, such as indigo dyeing. (For more information on the mechanism of indigo dyeing, please click here.)
In other words, the difference between dyes and pigments is that dyes bond to fibers, so the bonds are long-lasting, while pigments adhere to surfaces, so the bonds are not longer-lasting.