Gravitational redshift
There are two main ways to explain gravitational redshift and blueshift. One way connects it to the equivalence principle, which says that gravity and acceleration are kinda the same thing. If you think of it this way, the redshift happens because of something called the Doppler effect.