# Why should Fermi levels be equal?

Fermi level is defined as the energy level where the probability of finding an electron is 50%. Why should Fermi levels of two metals/semiconductors in contact be the same? Why don't the energy levels where the probability of finding and electron is x% line up?

Because being the Fermi level in one metal higher than the other, it means that electrons in the metal with the highest $E_F$ are able to go to lower energy states in the other metal, but not the other way around. Thus electrons will flow until both metals(or semiconductors, or combination) have the same Fermi energy, breaking this flow. Also you could think that at 0 Kelvin the probability of being above $E_F$ is 0%.