Yes, it has relation to quantum confinement. if you consider the problem of a particle in a box which has same analogy to the particle (electron) in side a potential well like structure created by the atoms which are separated by a distance of lattice constant.