The math in the fretboard
A vibrating string halved in length sounds exactly one octave higher. That single physical fact, combined with the decision to divide the octave into twelve equal steps, determines every fret position on every fretted instrument ever built.
Equal division means equal ratio, so each fret must shorten the remaining string by the same proportion: the twelfth root of two, about . Twelve of those steps multiply out to exactly two, which is the octave. The position of any fret measured from the nut follows:
where is the scale length and the fret number. Fret 12 gives , which is exactly half the scale, on every instrument regardless of size. On a 648 mm Fender scale that is 324 mm.
The consequence you can see by looking at any guitar is that spacing shrinks going up the neck. Each fret takes its cut from what remains, and what remains gets smaller every time. On that 648 mm scale the gap from fret 1 to 2 is 34.32 mm, while the gap from fret 21 to 22 is only 11.45 mm.
Fret 1 sits 36.37 mm from the nut on that scale. That number, and every other in the table, is a theoretical position in equal temperament, which is what a fretboard is built to.