Children usually inherit glasses from their parents. If either parent has glasses, then there is a fair chance that the children will get them. If both parents have glasses, the chances of the kids having glasses are more.
Sometimes parents do not have glasses, apparently neither do anyone else in the family, yet the child get them. This is also a possibility as heredity is not the only causative factor there could be many more reasons yet unearthed.
Let us try to understand the reason how people get glasses with diagrams
The below diagram shows the optics of the normal eye. Rays of light form a point of focus on the retina (sensitive part of eye), and therefore the eye can see clearly without any aid.