>>16786012
This, in the case of cosmological redshift. If expansion of space reduces the energy of a photon, then the lengthening of a photon's wavelength must dive the expansion of space. Essentially photons can be understood to exert pressure to spacetime
Gravitational redshift/blueshift is an exchange in the kinetic and potential energy of the photon; climbing out of a gravitational well, a photon loses energy, much like a particle with non-zero rest mass would, even if it keeps travelling at c.
Redshift/blueshift due to relative motion can be similarly explained as one explains the kinetic energy of any object