Trauma and the nature of the trauma, the way in which it happened. The particular movements that occurred in the specific event and other factors causing it. Weight, twisting, torque, sudden blunt force that the body simply can't compensate for.
Also, the unique characteristics of the individual's joint and associated tissues can play a role as with a hip (to an extent). Some hips and associated structures (can) make it more susceptible to dislocation. That's my recollection of a discussion I had with an orthopedic surgeon that has extensive experience treating athletes. I imagine that's possible with the shoulder and other joints.
Mainly though, it's the trauma and unique characteristics of the event which determines the extent of the injury. Stretching can even cause trauma depending on the specific event and there can be hypermobility issues. As was stated, forcing a structure beyond it's limits to do what it doesn't have the capacity. That's essentially the cause.