Headspacing, as I understand it, has a few purposes, not all of them safety related;
1) When assembling a rifle, to ensure factory ammo will fit
This is the one most closely associated with safety, but it's importance (and consequences, especially) are a bit overblown on forums. The primary goal is to make sure common ammo will fit, so it doesn't need custom sizing for good function. Too tight, and the action jams or won't lock, too loose, and the poorly secured case causes all sorts of issues. Issues like extractor damage, excessive brass wear, and in extreme cases, case head separation. When worrying about the last one, do remember that high pressure delayed/straight blowback designs like the five-seven and G3 allow the bolt to move quite a bit (by micrometer standards) while the case is pressurized, and the arrangement is perfectly safe within reasonable limits. The case whose neck you bump back and crimp repeatedly isn't the wet tissue bag you think it is (nor a blown-glass light bulb). If the bolt closes, and the round doesn't rattle between the stripped bolt face and chamber, it's unlikely things will turn out uglier than you knocking back shoulders a bit more than you should really have to (slight exaggeration here, but not by much)
2) When inspecting a rifle, to monitor bolt set back
This is the one that is actually the most critical to safety where it can bite you. As a new rifle wears in, the mating/bearing surfaces wear and polish, and the bolt opens up a little. No big deal. Over the years, the rifle has a squib load or two, some hot handloads, and a goober who shot it full of water a few times as a misguided "torture test." Now the bolt measures a little bit longer, but not because of wear. Because the mating surfaces have actually deformed under excessive load, stretching the action, peening the lug faces, and bending the lug attachments. Depending on severity, it's something to keep in mind, but still not worrisome. If after another group of rounds, the head space continues to grow, now you have seriously bad trouble on the horizon; the overpressure damage is so great the action is unable to maintain its structural integrity at working load levels, and is in the midst of failing by fatigue mechanisms (micro cracking). That's when the gun becomes a wall-hanger or demands service.
3) To chase the illusive mayfly of "Accuracy"
As with all things pertaining to precision shooting, the more consistent you can be in all things, the better you can be. Knowing exactly where the headspace sits enables you to size your brass for the perfect consistent fit, and eliminate another of the extremely long list of variables in the equation.
In the interest of morbid curiosity, did any of the famous gun writers ever do an experiment in which they gradually deepened or widened the chamber while firing spec ammo to see just how bad, for example, an M1 Garand had to be before it would reliably rupture cases? For some reason I'm thinking this was done with 1903's by someone (Hatcher?) and that a fairly shocking amount of room was needed to pop the case (like .1" or something
)
TCB