Why do the opposing sides of a D20 generally add up to 21
Opposite sides add up to 21 on a d20 for the same reason that opposite sides add up to 7 on a d6: if there's a manufacturing or design defect, and the die ends up slightly flatter than intended, then the average result of the die will not change.

Consider a d6 that ends up a bit flat: two sides opposite each other will both have an increased chance of being landed on. But since these two sides' numbers are "opposite" to each other, they will not affect the average of the die. For example, a d6 might have a 1/3 chance of landing on a 1, a 1/3 chance of landing on a 6, and, and a 1/12 chance of landing on each of the other faces. The average of this seriously-deformed die is: 1 * 1/3 + 2 * 1/12 + 3 * 1/12 + 4 * 1/12 + 5 * 1/12 + 6 * 1/3 = 3.5, the same as a normal die.

Of course, various other deformities (malformed corner, air bubble in the plastic, some enterprising fellow put a little lead in the die, etc.) will still play merry hob with the probabilities in an unfair way, but a flattened die will be somewhat fair in that its biases favor both high and low numbers equally. The layout for d8, d10, d12, and d20 dice were probably created from this same idea to make the dice somewhat fair if they're flattened.