They work by comparing the DNA of the subject to the DNA of people whose ancestry they already know.
So they are limited by the people they start with (and how accurate their ancestry information is).
This tends to mean that the commercial DNA-ancestry services are fairly good at specific ancestry groups or ethnicities (i.e. people with at most a few generations of ancestry in North America, and then more in Western Europe), but tend to be pretty unreliable for anything outside those groups.
Latest Answers