Origin of layer dependence in band structures of two-dimensional materials