Burials originally took place within the Church, depending on someones status in the Parish, the higher the status the nearer to the Altar, as the church filled up old burials were removed and burnt in the back of the Church, which is where Bon(e)fire comes from, then burials began to take place on the putside of the church, in the open ground, which was not walled in, until it was discovered that pigs could dig the bodies up, then walls were put around the graveyard and bodies were buried 6 feet deep as it was discovered that pigs wouldn't dig down so far as they knew they couldn't get out.
Public cemetaries were introduced in the mid 1800s, mainly in urban areas to make room for the masses. Some religions had seperate Burial Grounds, like the baptists and Quakers .