The momentum of a photon, despite its zero rest mass, arises from its energy and its wave-like nature. In physics, momentum is not exclusively associated with mass but can also be carried by massless particles like photons.
In quantum mechanics, particles can exhibit both wave-like and particle-like properties. Photons, as quantum particles, possess wave-particle duality. The momentum of a photon is related to its wavelength and frequency through the equation p = h/λ, where p represents momentum, h is Planck's constant, and λ is the wavelength of the photon.
When a photon interacts with matter or is emitted or absorbed by a particle, it transfers momentum. For example, in the case of light shining on a surface, photons transfer momentum to the surface's atoms or electrons, causing them to experience a recoil or change in motion.
So, the momentum of a photon is not a result of magic but a consequence of its wave-like behavior and the fundamental principles of quantum mechanics.