A constraint (DTD or Schema) is a set of "the rules" about a given XML grammar. What elements are allowed, what attributes they can or must have, what sub-elements are contained within an element, etc...
Advantages:
Robustness - you check your documents against the constraint, they pass, you know they are valid and can be parsed (consumed) as you expect
Documents your intentions - If you specify that element x must contain 5 sub elements y, then someone reading the constraint knows this is a requirement, not just "it so happened" in a given XML instance.
Can establish defaults for attributes - Only in a DTD or schema can you establish default values for attributes.
Entites - you can define your own entities, like a copyright symbol for instance, in the contraint, then use the entity name in your XML document.
DTD is the older constraint system that comes to us from SGML. It is quite well established, but it itself is not written in XML (but rather in its own syntax). XML-Schema is a constraint system written in XML, so you can use all your existing XML tools to edit/validate/transform it. It has other advantages too, but is newer technology, so the support is spotty.
HTH!