Prior to the turn of the (20th) century, most men's faces were shaved via the use of a straight razor (also known as a "suicide razor"), typically wielded by themselves or a barber:
That changed in 1903, when the Gillette company introduced the first system razor (or "safety razor"), which utilized a sharp double-edge blade attached to a reusable handle.
System razors were not only safer and easier to use than straight razors, but they also didn't need to be repeatedly sharpened. The blades were disposable, so once they became dull, consumers simply popped them out and inserted new ones:
That disposability posed a problem, however: What to do with the used razor blades? Even blades discarded as too dull for shaving were still plenty sharp enough to cause serious injury to someone who inadvertently handled, stepped, or fell on one. Many consumers had no regular municipal garbage pickup services available to them and instead burned and/or buried their trash, neither of which effectively dealt with the problem of safely disposing of potentially skin-slitting razor blades. (Even the availability of garbage pick-up services didn't completely ameliorate the issue, as children and others might still end up encountering dangerous razor blades in trash cans and dump sites.)
The solution that someone (the identity of whom is lost to history) eventually came up with was to install medicine cabinets with slots for used razor blades in new homes built from roughly the 1920s through the 1970s:
Simply push your used razor blades into the slot, and -- voilà! -- problem solved.
Out of sight, out of mind ... especially for later generations, who grew up in the era of completely disposable razors and had no idea that dropping used razor blades into slots in the back of medicine cabinets was ever a thing:
But of course, those used razor blades had to be going somewhere, and that somewhere turned out to be spaces within or between interior walls. You know, places that no one would ever need or want to go into ... until aghast modern homeowners engaged in remodeling efforts began to discover caches of old razor blades inside their houses:
Homeowners are advised to check bathrooms for the presence of such slots in the medicine cabinets of older homes before undertaking remodeling work, and to proceed with caution around those area areas if so.