In metals, work function and ionization energy are the same. The work function of a surface is strongly affected by the condition of the surface. These changes are a result of the formation of electric dipoles at the surface, which change the energy an electron needs to leave the sample.