If diving is not dangerous, why do we have so much safety equipment?
The level of danger is more about the diver attitude, not the environment.
Every increment you take away from the surface, where air is for all practical purposes both infinite and breathable, the more risk you have to manage. Both virtual (deco obligation) and hard (wrecks, caves) overheads increase complexity and increase the risks you must manage.
I can draw an analog to driving. Driving to work, on a route you know intimately, more or less in accordance with local traffic laws on low-speed surface roads, is pretty safe. Driving an unfamiliar route, less so. Driving that new route at night, in rain, in snow in fog, in high winds, all increase the risk.
With me so far? Great. Now, let's go racing! Get into your car with the fuel cell (to control the risk of fire), fire suppression system (ditto), Nomex suit (still about fire) with its gloves and booties, the safety cage, racing seat, 5-point harness, helmet, and HANS device. Know where the corner workers are because they have radios and bigger fire extinguishers. Know that there are a few ambulances positioned around the track. Know the meanings of the flags (red and yellow, in particuar).
Is it safe? A few racers die every year, and others are injured. Given racing miles and time vs. commuting miles and time, it is clearly more hazardous to race than to drive on the street. Likewise, technical diving (including cave diving) carries more hazards than recreational diving, and the consequences of mistakes are more severe.