Since every person inherited DNA from their parents, who inherited it from their parents, and so on, a person's DNA is made up of the DNA of their ancestors. If you and another person both have the same ancestor, there's a chance that you both inherited some of the same DNA