Hi,
Fermi level is the energy level where the Fermi function f(E)=1/2. Fermi function is the probability desinity distribution of electrons across the whole energy band. When an electron jumps from the valence band to conductance band, the distribution will change, however, the energy position where f(E)=1/2 will never change. This is the symmetrical point of the distribution. That why Fermi level remains constant regardless the bend of valence and conductance band. This could also be used to explain the constant Fermi level across different material connected together.
Ei refers to instrinsic Fermi level. It is located around the center of the band gap. generally, Ei = (Ec+Ev)/2. So, when the energy band bends, it bends also. To my understanding, it has no significant physical meaning here, simply to keep the following formula valid.
n = ni exp[(Ef-Ei)/kT], and
p = ni exp[-(Ef-Ei)/kT]
Hope this helps
ceyjey