  Density functional theory applied to a simple ionic material, MgO, is used as
a model system to clarify several aspects of electronic driven mechanism to
compensate for the diverging electrostatic potential in the polar structures.
We demonstrate that in the stoichiometric free standing films, the electronic
reconstruction is limited by the band gap. This produces a residual electric
field in the bulk of the sample which is extremely sensitive to tiny deviations
in electron transfer between two surfaces of the slab. In heterostructures, the
band gap is replaced by a new effective energy scale set by the band alignment
of its component. This changes the reconstruction pathways so that the
electronic mechanism can benefit from the smallest energy scale possible.
