Edinburgh Castle was built on top of Castlehill, an ancient remnant of a volcanic plug much like nearby Holyrood Park.