I've been diving since 1985 (30 years) and stopped counting dives around the 3,000 mark over a decade ago. I've been doing technical wreck and cave diving for the last 15 years, and I've had only a very small hand full of failures.
1. I had a dump valve fail on a wing (the recall came out for that valve that same week), but I was still able to trap air high in the wing, so it was no big deal other and preventing me from achieving level trim for the rest of the dive.
2. I've had three freeze flows on ice dives, once with a Scubapro Mk 3, once with a MK 15 and once with a Mk 25 - and I was more or less expecting the Mk 25 failure.
3. I picked up a rock in an exhaust valve recently on a cave dive causing it to breathe wet. It was inconvenient but would not have been life threatening even without the back up regulator. However, before electing to turn the dive, I unscrewed the cover, removed the friction ring and diaphragm, removed the rock, re-assembled the reg, and completed the dive as planned.
4. I had an old Balanced Adjustable regulator fail closed due to the legs on the lever losing tension and allowing the poppet to jump past the feet - but again that was not entirely unexpected as the regulator was already suspect due to poor condition, and even though it was a single tank recreational dive, the octo enabled a normal end to the dive.
----
Given the fairly simple and reliable designs, the varying levels of redundancy, and good practices, such as not over weighting, few failures will ever constitute a true emergency.
There are a few things you can do to minimize problems, such as avoiding BCs that have dump valves high in the BC. A simple elbow is far more reliable than a dump valve mounted base of the inflator hose, which if it fails, will prevent the BC from holding gas and providing lift.
Good pre-dive and post dive inspections will help you detect problems and maintenance issues before a failure occurs, and taking an equipment maintenance course can help you better understand your gear, and how failures can occur.