Maxwell's electromagnetic theory predicts that light is an Electromagnetic wave with perpendicularly oscillating electric and magnetic fields propagating in space.
However, the phenomena of Blackbody radiation and Photoelectric effect among many other phenomena are certain phenomena which can only be explained by assuming the particle model of light where each particle is associated with an energy
Therefore, Maxwell's electromagnetic wave theory which predicts continuous distribution of radiant energy in the wave envelope cannot explain certain phenomena where the discrete nature of photons is to be accounted for if one wants a theoretical explanation.
This calls for the notion of dual nature of radiation. Light (and other EM radiations) behave like both a wave (in case of phenomena like Interference, Diffraction or Polarization) and a particle (in case of phenomena like Blackbody radiation, Photoelectric effect or Compton effect).