The work function $\Phi$ is the amount of energy required to move an electron from a state where it is at Fermi energy $E_f$ in the bulk of a metal to a state where it is at rest at a point just outside the metal's surface. A mechanism for achieving this is known from the photoelectric effect where absorbing a photon provides the necessary energy.
I get confused thinking about what kinetic energy the electron should have leaving the metal. On the one hand, the energy states in the conduction band above $E_f$ have a higher kinetic energy and are less bound to the metal. This leads me to believe that the electron should leave the metal with a very high kinetic energy, but I get that the $\Phi$ energy is completely spent on overcoming the Coulomb attraction to a nucleus. So does the electron not go through higher conduction band states as it leaves the metal?
I also get confused thinking about the mechanism of the electron going the other way, from just outside the surface into the bulk.
My theory goes like this: The $E_f$ energy state has a very high kinetic energy, so starting from rest, the electron must acquire a lot of energy. But the Fermi-Dirac distribution says that almost all of the low energy states are occupied, so it seems that the electron cannot reenter the metal with a low kinetic energy. The metal initially has a positive charge, which must be at its surface directly across from the electron, and maybe it all works out so that the energy states that electron must accelerate through somehow open up because of this.
And does this mean that it takes $\Phi$ energy to remove an electron but $E_f$ to put it back?
I have no idea what I'm talking about, and I would appreciate if someone could explain how this works.