Classical electromagnetic theory predicted
that X-rays would not lose energy when scattered.
The effect depends on the energy of the photon
relative to the energy-equivalent of an electron.
Compton scattering is inelastic.
It happens when the energy of the photon is higher.
Thomson scattering is elastic but happens only when the energy of the photon
is much less than the mass energy of the particle
(when the particle’s Compton wavelength
is much less than the photon’s wavelength).
At the energy of visible light, photons can knock electrons from a surface.
This, called the photoelectric effect,
supported the concept that energy is quantized.
See also in The book of science:
Readings on wikipedia: