In case of n-channel MOSFET, we have p-type substrate and to turn ON the device we have to apply a positive potential at the gate terminal higher than the threshold voltage of the device. The postive gate potential will induce electrons in the channel to balance the positive charge in the gate. In doing so it first causes depletion and then strong inversion. Since Fermi level is is fixed and straight and so the only possibility is that the semiconductor bands (valance band, conduction band as well as Ei) must bend downwards near the surface, making EF above Ei and thereby resulting in planty of carriers.
Adding to what has been said by the colleagues, The conduction and valence band edges vary as the electrostatic potential of the device. When you apply a positive voltage on the metallic gate electrode facing a p type substrate of an enhancement n channel transistor, the voltage is distributed partly across the oxide and across the surface region of the semiconductor because of the field effect repelling the holes away from the surface and pulling electrons towards the surface leading to the depletion of the surface region. Due to this depletion charges the electrostatic potential of surface region gets higher than the interior.
Since the potential gets positive with respect to the bulk of the semiconductor, The electron potential energy gets more negative with respect that of the bulk. Since the band edges follow the variations of the electron potential energy, then they bend down
wards and their bend increases as we approach the surface of the semiconductor.
So, it is a pure electrostatic field effect.
best wishes
I would like to hint that band bending occurs also in a conventional pn junction.