I'm curious as to how these negligent discharges actually happen.
Varies by which negligence is the cause, of course. And humans are inventive and creative in that regard, if nothing else.
I'm sure many of these stories are skewed simply because the one in the know hides the actual truth of it. "Just went off" can be a nice way to smooth things over, if not overly effective at doing so.
Some drop it. Some fiddle with it to point of failure. Some blow the reholster. Some fail to execute the four gun safety guidelines religiously. Some have a "finger" problem while doing things other than actually firing for cause. Some attempt to clean the gun without first engaging the brain. Some clear the gun with something less than the full steps required to clear, or fail to double-check that the steps worked.
Myself, I've come close a couple times, in which I didn't first drop the magazine prior to racking the slide to eject the chambered round. This has occurred at the range, when my mind was more on the firing drill and lessons learned than anything else. But I retained muzzle control, went through the steps again, ended by visually confirming and sticking my finger into the chamber. Safe handling, layered procedures, double-checking ... it all helps. But, as was clear in these instances, so does repeated performance, again and again, until it's truly second nature. I'd been shooting less lately, and got a bit complacent. Didn't fire, but was able to catch myself in each of those couple instances prior to disaster. I'm sure many situations we never hear of go roughly this way, in which something got close but didn't go so far as firing.
Over the years, I've had two or three holsters that were something less than perfectly reinforced around the mouth, such that reholstering was a bit of a pain. Since I prefer semi-auto SA/DA or DAO pistols without a manual thumb safety, it can get a bit concerning when the gun doesn't easily reholster the first or second shot at it, given the risks of hanging up on a finger, clothing or the sweat shield of the holster. (Those less than well designed holsters are no more, though. Far safer to have a well-designed unit, in this regard.)
Modern well-maintained firearms almost never just "go off". If they did you would be hearing about massive recalls from the manufacturer. It is possible for a firearm to malfunction, but that is a very small portion of the nd's.
On my Rem 700, I'd had a Jewell HVR trigger installed professionally, but then adjusted the pull-weight down a bit low. On one occasion, bumping the butt of the rifle a bit hard caused the cartridge to fire. Negligence on my part for dialing it down that low, and I suppose even negligent for not waiting to chamber the next round until I was positioned down over the gun, on-target and ready to fire. Never happened again, once I new where the cutoff spot was. Bummer to have found it, but there isn't really another good way to find it. Knowing it, I was able to add just under a half-pound of pull back into the adjustment and avoid the situation again. A nice lesson.