Black body radiation curves are peaked because of the quantisation of energy into packets called quanta - only this theoretical model could explain the experimental evidence obtained in Planck's time.
Einstein then took the black body radiation theory (Planck's hypothesis E=hf, where energy is quantised) and used it to explain the photoelectric effect. He explained how photoelectric emission only occurs above a certain frequency (the work function) and that this energy is only transferrable in discrete amounts. Such principles revolve around his conceptualisation of light being quantised, like black body radiation, into particles called photons.