Each electron shell can hold up to 2n² electrons. Is there a geometric reason for this?
A good insight!

The number of electrons in each orbital are double the odd numbers. The s orbital can hold 2, p holds 6, d holds 10 and f has 14: double 1, 3, 5 and 7. If you add the odd numbers, you get a square number:

1 = 1

1 + 3 = 4

1 + 3 + 5 = 9

1 + 3 + 5 + 7 = 16

The doubling is due to the Pauli exclusion principle; in each orbital, an electron of a specific energy can be in one of two spin states.

It is interesting to see spectral lines split in a magnetic field (Zeeman effect) or an electrostatic field (Stark effect): one line may become 3, 5 or 7 lines. It clearly shows how orbital theory was derived.