Galaxies — vast collections of billions of stars, gas, and dust held together by gravity — are scattered across the immensity of space.