The OP posed an interesting philosophical question comparing cave diving with open water diving.
It has to be seen as a combination of:
- the chances of something going wrong;
- the consequences of something going wrong;
- the planned mitigation against something going wrong;
- the required training and experience required to execute that dive.
Open Water diving has a set of problems that can go wrong which is basically a lot fewer than the things that can go wrong in a cave/overhead environment. Each of these problems are planned and practised in both types of diving:
- OW out of gas: use your buddy to breathe from and do a controlled ascent.
- Cave: OOG: you live by the sacred "Rule of thirds" where you always leave a third or more gas as your reserve; you'll always carry sufficient reserve gas and switch to that; you can use another diver's gas (if possible); you'll always be aware of what gas you have and what gas options you have; they'll always be practising gas failure drills appropriate to the equipment being used (OC sidmount, OC backmount, CCR/rebreathers); the list goes on.
The level of planning performed before diving is very different:
- OW planning: minimal performed depending on how close to recreational limits you're diving to; you'll probably just have a simple team/boat/buddy/DM rule: hit 80 bar 1200psi and ascend but get back to the boat with 50bar/750psi; the main escape route plan is to quickly get to the surface.
- Cave planning: in short, lots of planning. Reviewing the environment and expected risks; reviewing the route; planning the route and alternatives; ensuring appropriate equipment for that plan; gas plans; backup gas plans; communicating those plans to all divers concerned including changes.
The levels of training between the two is quite different.
- OW dives can be performed by almost complete novices with very little experience, skills and training including mediocre core skills (buoyancy, finning, trim).
- Cave divers have to demonstrate extremely solid knowledge, skills and lots of experience with supreme core skills. Cave training is demanding and difficult. Their mental attitude has to be right. Caves are no place for novices.
One could go on for much longer with the comparisons.
But back to the original question:
is cave diving safer than OW diving? They're very different, only sharing the basic "diving underwater with SCUBA", but so completely different in their execution.
A bit like comparing someone driving to work in a car against a racing driver. The car driver does little planning and just gets on with it -- OK, ensures the car's working, enough fuel and is taxed and insured.
You're unlikely to have an accident driving to work, but if you do then hopefully the car will save you.
A racing car driver does masses of preparation in advance of the mission/race. They have all the skills and equipment to handle the
expected crash. It's somewhat of a team effort to run that race.