Permission was granted to the anatomy department of the University of Edinburgh to be allowed to use the bodies of criminals who had been hanged or otherwise executed for the purposes of learning about anatomy. This part of the death sentence was known as "anatomising"
In addition, the homeless who had no one claim their bodies and who then became the property of the Council were also given over to the anatomy department.
However, it was quickly learned that this could be a lucrative business adventure as the Anatomy Dept would pay rather princely sums for a freshly deceased cadaver. This of course gave rise to grave-robbing or body snatching. Late at night, under the guise of darkness, the seedier side of the overcrowded populace of Edinburgh would enter the local graveyards and dig up the newly interred bodies. They would then drag them off to the Anatomy Dept at the University of Edinburgh's Medical School where they would be paid in cash, apparently no questions asked.
To prevent their loved ones from being disinterred, family members of the poorer of the city's populace would take turns sitting vigil at the graveside of their dearly departed for three to five days, thinking that after this length of time, the bodies would be of no value to the grave-robbers.
The more well-heeled would pay for mortsafes to keep their loved ones safely in the ground. These two are at Greyfriar's Cemetery in Edinburgh's Old Town:
and in some cemeteries, such as St Cuthberts they had guards posted to ward off the resurrectionists. This is the guard tower at St Cuthberts:
I love these old remnants which serve as visual reminders of a very sinister piece of Scottish history.