It compares a tiny portion of your DNA with those of all the other people in the company’s genetic database.
It is easy to misinterpret these test results because of these companies’ misleading advertisements. What the results do tell you is how you relate to the people currently living in these parts of the globe. It compares a tiny portion of your DNA with those of all the other people in the company’s genetic database. If it matches the testing company’s reference population of a specific country, then that country will appear in your “Ethnicity Estimate” list. The percentage represents how strongly the patterns of your genetic markers match those ethnicities. In other words, the results are simply the company’s “best guess”. It is limited by several factors, as explained in this Vox video.