Take a scale where the octave is divided into N equal parts. See how close you can get to a 'perfect fifth': a frequency ratio of 3/2. Plot the error as a function of N. You get a complicated pattern...
... but if you draw 12 colored lines through the different values of N mod 12, you get this!
So don't let anyone tell you the role of the number 12 in musical scales is purely a cultural artifact: it's built into the math!
Please don't be put off by the jargon: 'N-TET' means 'N-tone equal temperament', which means a scale where the octave is divided into 12 equal parts. Most pianos use 12-TET.
You can see an interactive version of this here:
https://math.ucr.edu/home/baez/tuning_book/html/best_fifths_5-60_strands.html
