Most internet sources when talking about the causes of myopia only tell some variation of the following taken from webmd:
People who are nearsighted have what is called a refractive error. In nearsighted people, the eyeball is too long or the cornea has too much curvature, so the light entering the eye is not focused correctly. Images focus in front of the retina, the light-sensitive part of the eye, rather than directly on the retina, causing blurred vision.
Nearsightedness runs in families and usually appears in childhood. Usually, the condition plateaus, but it can worsen with age.
This tells us that the cause of the refractive error is the too long eyeball or the excessive curvature of the cornea, but nothing about why this may happen other than an observed genetic component.
Do we know anything more than this about what causes the eyeball elongation and/or the excessive curvature of the cornea?