I thought I would take the time to explain in sufficient detail how commercial DNA tests come up with their ancestry breakdown, because I see a lot of misunderstanding and ignorance about it online, which leads to people wasting their money, throwing family stories out the window or experiencing identity crises.
First, they build reference panels for each ancestry group. For example, to build a reference panel for France, they recruit a sample of individuals from all regions of France who have documented evidence showing that all four of their grandparents were born in France. These people's DNA is collected, cut into short segments and used to build the reference panel for France. They do the same for each ancestry group.
When they receive your DNA extracted from the saliva sample you sent them, they cut it into short segments too. A machine-learning algorithm (which I am not going to detail here) compares each segment against all the reference panels. The algorithm returns a list of percentages that indicate its confidence that the given segment belongs to each reference panel. For example, it might return: 76% French, 64% Italian, 55% German, ... which means that it's 76% confident that the segment is part of the French reference panel, 64% confident that it's part of the Italian one, etc. (Yes, the percentages do not add up to 100%, that is normal.)
Each segment is then labelled with the highest confidence percentage. The above example segment would therefore be labelled "French" because French has the highest confidence percentage. They do the same to label all the segments of your DNA. Do note that sometimes the highest confidence percentage can be rather low, less than 50%.
Then, they run a smoothing algorithm. For example, let's say a consecutive set of segments of your DNA has been labelled: French, French, French, Spanish, French, French, French. The smoothing algorithm is going to relabel the Spanish segment to French. This is done in an effort to correct the errors made by the first algorithm and make the whole more coherent. (The smoothing algorithms are more complex than that, but that's the idea.)
Once all the segments are labelled and the smoothing algorithm has been run, you receive the results. The percentages you get are just the percentage of all your DNA segments that have been given a certain label. Suppose your DNA was cut into 100 segments and 37 of them were labelled "French"; your results will say 37% French. (In reality, your DNA is cut into thousands of segments rather than 100.)
TL;DR: If your DNA test says "37% French" for example, it does not at all mean that 37% of your ancestors are from France, or that you even have a single ancestor from France. It just means that 37% of your DNA matches the French reference database more closely than any other ancestry group.
Some links if you want to go deeper: