How are ionization energy and the photoelectric effect related?

In the Photoelectric Effect light of a certain frequency $f$ hitting the surface of a metal frees electrons that will be emitted from the metal.
This is because the photons of light carry an energy $E = h f$ ($h$ is Planck's constant) that it is enough to ionize the surface atoms of the metal.