The whole 10 day cave syllabus is designed around accident analysis. This boils down to three main causes (omitting stupidity)
1- incorrect gas planning. Law of thirds. One third in. One third out and one third reserve.
2- failing to mark lines/visual rather than phsically linked jumps.
3- failure of light source.
Again, like flying it is another swiss cheese.
Unfortunately I was right in the middle of one in 2016 in Tulum. Having to do a body recovery after someone who should have known much better screwed up. Very unpleasant.