Someone on Facebook brought up Mortsafes (wiki entry here) recently while Sharing an old meme showing a picture of a Mortsafe with text suggesting it was being used to keep something in a grave rather than out. Naturally, that's a great gaming idea and such thinking is encouraged among Gamemasters. However, let's look a bit more closely at these curiosities of interment and dig a little deeper into some ideas of how they might be further used.
First, there are a number of kinds of Mortsafes and other structure made for the same purpose. The cage type Mortsafe seems to be the most common and there are many styles of these as well. Likely, these are more widely used because they can handle most situations while using the least amount of material. Since a cage is a mesh of metal bars it will be less costly than any complete encasement whether it is a solid metal box or a stone tower with a sealed entrance or no door at all.
But is it too easy to simply suggest that their use in a fantasy game is to keep the undead within the ground? I think so and it doesn't take into account all the nasty ramifications available if one sticks closer to the real world explanation for them. There was a time when medical science had trouble finding enough corpses on which to experiment, and mainly they were used for training students who would go on to keep people from becoming corpses themselves. But religious beliefs held that someone needed to be in the ground and undisturbed to eventually achieve a place in the afterlife. This led to a great deal of grave robbing and even shipping the bodies across and out of the country or origin. Here the actual real world situation presents enough conflict and grey areas to fuel a large portion of a campaign. Does a party of player characters side with the religious leaders or those seeking to advance medical science? Can alternatives be found? What are the implications in a world where folks can in fact be brought back from the dead? Should all religions in a fantasy setting even condone resurrection? Many questions need to be asked by a GM as a campaign is developed if Mortsafes are to be added.