During hertz experiments to measure the speed of waves, he uncovered that their speed remained the same (c), which supported Maxwell’s theory. He also uncovered the photoelectric effect, but he didn’t investigate this any further.
A black body is one that absorbs or emits all incoming radiation. Classical Physics predicted, using the wave model for energy, which as the wavelength of a wave decreased, its energy intensity increased infinitely. This violates the law of conservation of energy, and was known as the ultraviolet catastrophe. Experimental data instead revealed black body radiation curves which did not match the predictions of classical physics, where most of the energy is emitted at a peak wavelength dependent on temperature.
This resulted in Planck and his hypothesis; all energy emitted and absorbed by a block body is quantised and occurs in discrete amounts called quanta. Furthermore, the whilst Planck was proposing his quantum theory, other scientists investigated the photoelectric effect that Hertz had observed, however their experiments produced results which couldn’t be explained by the existing theory of light (light being a wave).
This is where Einstein came in and extended Planck’s idea about quantisation of energy in a black body to all light, where he suggested it occurs in discrete packets called ‘photons’ with energy of E = hf. When a photon interacts with matter, it either transfers all or none of its energy. Thus, Einstein’s light model offers a wave-particle duality of light, in which it has a dual nature, such as wave properties (reflection, refraction, interference patterns) and particle properties (energy transfers, where photons act like small particles. Einstein essentially explained the Black Body Radiation curves as well as the results and problems with the photoelectric effect experiments.