It seems that, like the way that environmental factors affect jaw development[1], environmental factors that are different between modern lifestyles and pre-historical ones drive the development of myopia.[2] But there have always been a percentage of people who are myopic due to other factors, as well, so it's not a single story.
[1] https://www.bbc.com/news/science-environment-15823276
[2] https://www.aao.org/editors-choice/sunlight-exposure-reduces...