One way to think about how it works is book copying as an analogy. In fact, copies of books are related this way too.
Let's say you have a hand copied book somewhere in Eastern Europe. As in the real world scribes can be very good copiests but also not precisely perfect.
If our book is copied a lot then some of the copies are bound to have errors in them. If those copies are then copied at some other place the errors will be copied too and, often, new ones added. If this continues you can see that it will be possible to construct a relationship between the book copies.
You might not be sure of which is the original but if you pick a copy as a starting point you can judge which is the next made from it. You infer this because the next copy will have the fewest errors from your assumed orginal
You will see that one error will appear in a whole series of copies but not in another bunch of copies. From that you can infer which copies are from one book and which from another.
It isn't, of course, a perfect analogy since the copies only each have one "parent". I guess you could say that sometimes a book is copied half from one copy and half from another.
From this you'll get a whole bunch of subgroups and branches just like with the DNA.