You are conflating DNA analysis with the matching algorithm. DNA analysis is in fact completely independent of the paper record. There are two types of matching being done by Ancestry:
1) Biogeographical analysis, which gives you your ethnicity breakdown.
2) Segment matching, which gives you your predicted relationships.
The second of these is done entirely using DNA. What the computer does is identify other people who have tested who share common segments with you. They are looking for individuals who have a piece of DNA of a certain size (at least 5 million base pairs or roughly 5 centimorgans) at the same location (beginning and ending SNPs). Depending on the size and number of matching segments, the computer calculates an approximate degree of relationship--such as sibling, first cousin, 4-6 cousin, etc.
Only after this is done does a separate computer program compare family trees. Ancestry then gives you a list of surnames in your match's tree out to 10 generations (direct ancestral lines only) and identify any surnames that are common to your tree and your matches. It also searches for individuals in both trees that appear to be identical, and marks those with a hint leaf.
So Ancestry doesn't assign people to reference groups based on a paper record, but only on how well their DNA pattern fits with those groups. The connections between individuals are made first through DNA matching, and then subsequently the trees are identified and displayed for you to analyze.
Hope this is fairly clear. It has taken me a long time to understand how all of this works and I learn something new almost every day.