The number one reason RDs get torn off this way is because they overshifted into the spokes. The second reason is a damaged chain binds in the idler cage and pulls the whole thing back. The third reason is something like a twig of other debris gets caught up in it, or it hits a obstacle like a rock you passed too close.
You don't feel it happening until it's too late, because the force involved is so small compared to pedaling forces, or in the case of getting caught in the wheel there's simply too much momentum.
The third cause is blind luck, it happens especially on mountain bikes and those are the breaks. But the first two usually give many warning signs and can be easily be prevented.
The RD limits are usually set correctly when the bike is first set up, but over time the bike gets dropped, or other things happen and the RD hanger gets bent in a bit. This causes the indexing to go off a bit, and the owner corrects it with the trim adjuster, and goes on his way. But, the bending of the tabs also moves the entire RD along with the limits inward, so while you've corrected trim the limits are now off. So the first way to prevent losing the RD is to remember that RD cables never get tighter. If you find yourself adjusting the trim to bring the RD out a hair, it can only be because the hanger got bent in. Simply correcting the trim without rechecking the inner limit invites disaster later on.
The second gives plenty of warning, Chains don't get stiff links all of a sudden. It's a process that happens over time. If you find the chain skips or hear the RD clicking and pinging at intervals as you pedal, stop and check it. If the chain has stiff or damaged sections deal with it ASAP.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.