If you’ve ever heard a police car drive by with its sirens blaring, you’ll be able to understand redshift and blueshift. As the car went past you probably noticed that it sounded higher pitched as it approached you and lower pitched as it drove away. This is known as the Doppler effect, and it’s caused by sound waves being pushed closer or further away from each other.
The same thing happens with light. It turns out that as a light source moves towards or away from us on a large scale, the light also gets shifted – but in this case its wavelength on the electromagnetic spectrum gets shorter or longer. Wavelength is basically an energy pattern in light that determines what colour it is. Longer wavelengths correspond to red, while shorter wavelengths correspond to blue or violet.
When we observe a galaxy in the universe, we find that its light is generally either redshifted or blueshifted. The former is more common, as the universe is expanding and everything is moving away from everything else. The more distant a galaxy is – and thus the faster it is moving away from us – the higher its redshift is. A few galaxies, like the Andromeda Galaxy, are moving towards us however and are on a collision course with our Milky Way. Andromeda’s light is blueshifted. Galaxies that are spinning can also exhibit a slight blue or redshift, as one side of the galaxy moves towards us while the other moves away from us.