Dopants also have the important effect of shifting the energy bands relative to the Fermi level. The energy band that corresponds with the dopant with the greatest concentration ends up closer to the Fermi level. Since the Fermi level must remain constant in a system in thermodynamic equilibrium, stacking layers of materials with different properties leads to many useful electrical properties induced by band bending, if the interfaces can be made cleanly enough. For example, the p-n junction's properties are due to the band bending that happens as a result of the necessity to line up the bands in contacting regions of p-type and n-type material.