Shoulder dislocations typically occur when the restraining ligaments and muscles are damaged or become lax and therefore the head of the humerus
cannot stay in its normal position. Since you have a history of trauma it implies that there was some form of damage to the joint capsule because of which the dislocation has occurred. The shoulder joint cannot heal by itself in this situation and is therefore notorious for recurrent dislocations. If the degree of dislocation is quite small and you do not have recurrent episodes then active exercises to strengthen the surrounding muscles can help you in keeping the shoulder joint in its place somewhat. However, if it is too distressing then you can go in for surgery which would correct the anatomic abnormalities.