https://doi.org/10.1351/goldbook.B00629
The distribution of potential in the space charge region of a semiconductor results in a change in the electron energy levels with distance from the interface. This is usually described as 'bending of the energy bands'. Thus the bands are bent, upwards if and downwards if , where is the free charge density. When the condition of flat bands is met, provided no surface states are present.