That's why this exists. There's a lot of cruft out there when you look for music theory that isn't what the HN crowd is interested in. The circle of fifths is useful but it isn't music theory, it's this magic thing without explanation that you're told to memorize in most expositions. The opening of this blog is a good, HN-oriented approach towards actually the theory behind music scales.
This happens naturally when you can practice an art/craft/skill without deep understanding of the complex system that underlies it. Since that understanding isn't interesting to many, the system survives by teaching an incomplete or inaccurate model that works most of the time. The full understanding only comes with actual practice, and is [implicit knowledge](https://en.wikipedia.org/wiki/Tacit_knowledge) rather than an explicit one. This is sufficient for most people to master the art/craft/skill.
For example, you don't find the info from this article in the wikipedia page on Music Theory, though you do find it in the "Music and Mathematics" page. I understand that there's more to music theory than rational numbers and the twelfth root of two, but it was the first thing that ever explained to me why something was true in music. In contrast to the circle of fifths which shows that there is a pattern but does not explain form where that pattern came.
[1] Actually I googled this one and it exists and it seems to be about the design of aircraft; a case where it's perhaps more theoretical than I would have guessed.
That said, rational numbers and twelfth root of two etc. aren't exactly what musicians or composers would be thinking about, but rather scales, intervals, chords and progressions. That's the music theory the OP was arguably looking for. Those are introduced on the Wikipedia page: https://en.wikipedia.org/wiki/Music_theory#Fundamentals_of_m...
The circle of fifths is not magic. Every step you take on the circle of fifths moves one note in the key by a semitone.