Being buried alive is a fear that has been with humanity for a long, long time. As early as the Greeks one can find stories of people being prematurely pronounced dead and accidentally burned alive on their funeral pyres. At various moments throughout history, this fear, this Taphephobia, has actively gripped the Western mind. The terror wasn't without it's basis in reality.
One circumstance in which live burials are thought to have often taken place were during outbreaks of disease such as the black plague. Due to the rapid spread of the disease victims were buried almost immediately after death, and sometimes beforehand. These circumstances would repeat themselves again with the cholera outbreaks throughout Europe.
Throughout the enlightenment, doctors were learning more about the human body and death. As they learned to revive people who were previously considered dead (such as drowning victims via the recently invented mouth to mouth resuscitation) doctors began to question if all the people they were burying had truly been dead. With increasing reports of premature burial, by the late 1700s the fear of being buried alive had fully taken hold of the Western mind.
And then folks dreamed up many ways to avoid this horrific fate, which you can read about. Link
(Image credit: Illustrator Harry Clarke)