Gravitationally bound systems of stars, gas, dust and dark matter. They are the units in which the visible matter of the universe is organised, and that they exist outside our own was established only a century ago.

A spiral galaxy. The disc contains stars, gas and dust arranged in arms, and the central bulge holds older stars and, in most cases, a supermassive black hole.
A spiral galaxy. The disc contains stars, gas and dust arranged in arms, and the central bulge holds older stars and, in most cases, a supermassive black hole.Credit: The Hubble Heritage Team (AURA/STScI/NASA)NASA Headquarters-Greatest Images of NASA (NASA-HQ-GRIN) (Public domain).

A galaxy contains stars in numbers ranging from millions in dwarfs to hundreds of billions in the largest.

It contains interstellar gas and dust, which is the material from which new stars form and which absorbs and reddens starlight, obscuring parts of the disc.

It contains dark matter, inferred from rotation, which appears to constitute the majority of a galaxy's mass and is treated in its own capsules.

Most large galaxies contain a supermassive black hole at their centre, with masses from millions to billions of times the Sun's, and the Milky Way's has been observed directly through the orbits of stars around it and imaged by the Event Horizon Telescope.

Spirals have a flattened rotating disc with arms, a central bulge and a surrounding halo. Star formation continues in the arms, which is why they appear blue. Barred spirals, including the Milky Way, have a straight bar of stars through the centre.

Ellipticals are smooth and featureless, ranging from nearly spherical to strongly flattened. They contain little gas, form few new stars, and their stars are old and red. The largest galaxies known are ellipticals.

Irregulars lack clear structure, are generally smaller, and are frequently gas-rich and actively forming stars.

Lenticulars are intermediate, with a disc but no arms and little ongoing star formation.

Edwin Hubble classified galaxies into this scheme in 1926. He arranged it as a sequence and suggested it might represent evolution from ellipticals to spirals, which is now known to be wrong: the sequence is a description of appearance, and if anything the evolutionary direction runs the other way, with mergers of spirals producing ellipticals.

An early photograph of the Andromeda nebula. Before distances could be measured, whether such objects lay within the Milky Way or far outside it could not be settled.
An early photograph of the Andromeda nebula. Before distances could be measured, whether such objects lay within the Milky Way or far outside it could not be settled.Credit: Isaac Roberts (d. 1904) (Public domain).

For most of astronomical history, the Milky Way was assumed to constitute the universe.

Faint fuzzy objects called spiral nebulae were catalogued, and whether they were nearby clouds within our own system or distant systems of their own could not be decided without distances.

The question was debated formally in 1920, in what became known as the Great Debate, between Harlow Shapley, who held that the Milky Way was the whole universe, and Heber Curtis, who argued the nebulae were separate island universes.

Edwin Hubble settled it in 1925 by identifying Cepheid variable stars in the Andromeda nebula. Cepheids pulse with a period related to their intrinsic brightness, a relationship established by Henrietta Swan Leavitt, so measuring the period gives the true brightness and comparison with the observed brightness gives the distance.

The Andromeda galaxy. Identifying variable stars within it established that it lies far beyond the Milky Way, which multiplied the known size of the universe.
The Andromeda galaxy. Identifying variable stars within it established that it lies far beyond the Milky Way, which multiplied the known size of the universe.Credit: NASA/JPL/California Institute of Technology (Public domain).

The distance was far beyond any plausible extent of the Milky Way. The universe was suddenly known to contain other galaxies, and the change in scale was among the largest single revisions in the history of astronomy.

Hubble then found that galaxies recede at speeds proportional to distance, which is treated in the Hubble law capsule and is the observational basis of cosmic expansion.

Galaxies are not spread evenly. They occur in groups of a few, clusters of hundreds or thousands, and superclusters.

On the largest scales they form filaments and sheets surrounding vast voids, an arrangement described as the cosmic web, which matches the structure that simulations of gravitational growth from small initial fluctuations produce.

The Milky Way belongs to the Local Group, with Andromeda and around eighty smaller members. Andromeda is approaching, and the two are expected to merge in several billion years.

Galaxies evolve through star formation, exhaustion of gas, and interaction.

Mergers are common and consequential. When galaxies collide, the stars almost never touch, since the distances between them are enormous relative to their sizes, and the gas clouds do collide, which triggers bursts of star formation. The result is generally an elliptical.

Active galactic nuclei occur where a central black hole is accreting material rapidly, releasing enormous energy. Quasars are the most luminous form and are visible across most of the observable universe, which makes them useful probes of the early universe.

Galaxies stop forming stars when their gas is consumed, expelled or heated, and why some quench earlier than others is an active question.

The James Webb Space Telescope has found galaxies that appear more massive and more mature at very early times than models predicted, which is currently being worked through and may indicate that early galaxy formation was faster than assumed.

Galaxies are the structures in which stars, and therefore planets and the elements produced in stars, are assembled and retained, and the history of the universe's visible matter is the history of their formation and merging.

Establishing that they exist beyond our own also produced one of the largest changes of scale in science. Within a decade the universe went from a single system of stars to one containing an unknown but enormous number of comparable systems, and the observations that showed this also revealed that it is expanding.