The vacuum level represents the energy threshold for an electron to escape a material's surface. It typically lies above a semiconductor's conduction band and serves as a reference for electron energies. In semiconductors, electron affinity is the energy gap between the conduction band minimum and the vacuum level. The work function is the minimum energy required to liberate an electron from the Fermi level to the vacuum level and is material-dependent. Metals exhibit high work functions, around 2 to 5 eV, due to their dense Fermi level states. Semiconductors exhibit variable work functions as their Fermi levels change, influenced by doping and temperature. A metal and semiconductor in contact achieve equilibrium, creating a continuous vacuum level across the junction. Simultaneously, charge transfer continues until the Fermi levels align, causing energy band bending in the semiconductor and forming a Schottky barrier. The junction's barrier height is determined by the metal's work function and the semiconductor's electron affinity.