Einstein realized that a theory of electromagnetism differing fundamentally from Maxwell's would be needed to explain this result, yet it must include Maxwell's results because they worked perfectly for almost every other case. For the core idea, Einstein went back to the debate between Newton and Huygens and, effectively, sided with Newton. That is, he proposed that light had a particle nature and could exist only in packets of a certain energy "size" that depended on the wavelength of the light.
In this framework, light intensity only depended on the number of light packets at a given wavelength instead of the electric field amplitude of a single, electromagnetic wave. Maxwell's field intensities can be thought of as the fields of Einstein's light packets overlapping in a given place. The photoelectric effect arises from the energy of a single light packet being used (absorbed) by an electron (beta ray) to escape the forces keeping it inside the metal. All of the light packet's energy turns into kinetic energy of the newly freed electron, except for the energy needed to escape the metal.
So, Einstein's theory explains the constancy of the electron's kinetic energies
as the light gets brighter while the color stays the same. Since the energy
of the light packet did not change, the electron could not get more kinetic
energy. The increased number of light packets only generates more escaping electrons,
in direct proportion to the number of packets. (The use of the term "light
packet" gets cumbersome after a while. The term "photon" was
coined to use instead.)
Did Einstein's conjecture of the packet size for light come uniquely from his intellect alone, or was it based on other work? Well, we have not mentioned the other paradox that was named above yet, the one called the ultraviolet catastrophe. It was being worked on at about the same time as Einstein was looking into the photoelectric effect, and he knew what was being done there. So what is the ultraviolet catastrophe?