When reading/learning about scales, I find that all resources tend to treat the major scale as the foundation for everything that follows i.e. if major is 1 2 3 4 5 6 7, then the harmonic minor is 1 2 flat3 4 5 flat6 7.
However, I am doubtful that this is how the different scales originated, for example this wikipedia article suggests that the pentatonic scale was discovered in its own right independently of the major scale.
Could someone explain broadly when/how the different scales came into being (were 'discovered') and/or recommend a good resource that could explain this?
Thanks in advance