Many reasons for that, but foremost is MONEY. If an aircraft model is considered dangerous by the public, nobody will fly in it, hence no more sales to airlines, followed by bankruptcy. Boeing, Airbus, etc are hugely important to their countries economies.
Therefor accident investigation has advanced to a tremendous state of expertise, fueled by money.
If the two examples you gave were civil, and had crashed and been recovered I'm pretty damned sure....
The first one solved quickly and easily. Indeed, I recall a DC-9 brought down by an intermittent short in a wiring harness. That was a miraculous catch!
The second one solved (assuming modern FDRs) to a fairly high degree of certainty.
Not flaming, just opining.
The military is more strict than the civilian world when it comes to aviation safety. They will ground the fleet quick and not have to worry about monetary losses. I’ve worked both sides and compared to the military the civilian side is scary.