People tend to inherit groups of SNPs together, called a haplotype. When Ancestry analyzes your DNA, they're dividing it up into smaller chunks and assigning each chunk an “ethnicity” by comparing the haplotype to those of people in the company's reference panel groups.