The simple difference is that a pigment is insoluble in water. So, when you mix it with water or another liquid, it becomes a suspension. Over time, a suspension will settle, and you'll have to mix it back up. Or, if the liquid were to evaporate, the dye would remain.
A dye is generally soluble in water, or already a liquid. It doesn't settle, and if it evaporates, everything will go. Historically, dyes came from natural sources such as mashed berries, boiled plants, bugs and various vegetation.
This site contains a more scientific comparison:
https://www.duraamen.com/blog/differences-between-dyes-and-pigments/
You can also find some encyclopedic definitions on Wikipedia, which get into the way the compounds and molecules interact on a more fundamental level.