Seems like a legit manufacturing error... twice. The first battery would short the electrodes over time... while the second battery would be punctured over time. Both seemed to be because of the high-amounts of deflection (aka: your ass sitting on the phone) that was beyond expectations and not tested for.
In both cases, a short-circuit would erupt, eventually causing a fire... as is common with any Lithium-Ion technology.
So the batteries were functioning when they left the factories. Only after being used in the real-world (with thinner-and-thinner phones that offered less-and-less protection for the battery) would they break, and only after weeks of use. Still, Samsung seems to be taking responsibility here and are doing a good job at being transparent about the issue. I'd say I'm personally impressed with their explanation and how they handled this crisis.
I think this event should serve as a warning to all other manufacturers: the "thinness" of phones are reaching practical limits. The phones are now flexing significantly under standard use, and that is going to cause some absurd edge-cases moving forward.