What is ancestry?
I think some of the confusion in ancestry proportions stems from the fact that 'ancestry' can really mean several different things in different contexts. I would really encourage people to read this short piece, as it does a good job of clarifying what the different terms mean https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1008624
What something like 23andme is trying to do is to infer how much of your genome most closely matches the genome of a particular pre-specified reference population. This is relatively easy to interpret if one parent if from Nigeria and the other is from Norway, since it will roughly be 50% Norwegian and 50% Nigeria, but becomes more complex to interpret when someone is 70% Norwegian, 20% Danish and 10% Swedish, for example.
Summary of the 23andme process
Since you specifically asked about 23andme, I will try and give you a relatively simple explanation of how they end with the numbers that you might have got on the report.
What 23andme are trying to achieve is essentially a 'classification' problem - they have a genome from an individual of unknown ancestry (call this the target individual), and they would like to describe it in terms of some pre-defined set of different ancestries (like 'Norwegian' or 'Nigerian'). To achieve this, they first need to assemble some kind of reference dataset of individuals of whom they know in advance to be of a certain country. For this, they will choose individuals who they know have e.g. all of their grandparents and great grandparents from Norway - so they genomes of these individuals will be reflective of general Norwegian ancestry.
They use something called Support vector machine Learning, which is just a fancy computational method, to 'learn' what segments of Norwegian ancestry look like. This is analagous to the AI algorithms which are able to tell the difference between an image of a cat and a dog. If you 'train' the AI with enough labelled examples, it can accurately classify new images. In the same way, if you train the SVM algorithm with enough examples of what Norwegian or Nigerian DNA segments look like, it can classify the probability that a new segment comes from a particular reference population.
They then take the genome of target individuals and split it up into chunks along the genome (something like 100 chunks per chromosomes). They then apply the SVM algorithm to calculate the probability that a particular chunk comes from a particular reference population. So for example, there might be a certain chunk of the genome which has a 70% chance of coming from the Norwegian reference population and a 30% chance from come from a Danish reference population. If the individual is admixed, the the next window may have a 90% chance of coming from the Nigerian reference population and a 10% chance of coming from the Cameroonian reference population.
They will then go across the genome and look for windows of 'high-confidence', where the probability of the window coming from a particular reference population may be higher than say 90%. If you add up the high confidence windows across the genome for each reference population, you will end up with your overall ancestry proportion for that population.
Other ways of inferring ancestry
There are many, many other ways of inferring ancestry proportions/components. For example, Principle Component Analysis, ADMIXTURE analysis, clustering methods, all of which have different strengths and weaknesses.