> A mistake in an aircraft, combined with some bad luck, leads to a crash.
Not always. You can actually push your luck pretty hard in an airplane and get away with it 99% of the time. There are pilots out there who are accidents waiting to happen.
The point is that there is almost never a single cause for any accident. It is almost always due to a confluence of multiple events. This should be expected. Engineers can be reasonably expected to think of the contingencies related to the system they are actively working on, but generally work under the assumption that the rest of the device is functioning normally. A nonfatal error in a normal situation can become fatal when combined with two or three other nonfatal conditions.