For much of history, the church or churchyard were the only places for burials.
The great and the good could be interred inside the church (hence the term 'stinking rich' - from the smell). All other members of society were buried in the churchyard.
Individual plots and headstones were not common until the 17th century. With the increase in population brought about by the Industrial Revolution, and very high mortality rate, churchyards became unsanitary.
Legislation enacted between 1832 and 1906 gave local government the power to act and privately-run cemeteries were established.
(text and images courtesy of Heritage Inspired)