Woman wearing white shirt holding the top and bottom of a cocktail shaker
Why You Find Bartenders Shaking Drinks Over Their Shoulders
Though showmanship is part of the appeal when bartenders vigorously shake drinks over their shoulders, they actually do this to keep the shaker's top pointed away from patrons.
If the lid of the shaker comes loose while aimed at customers, the patrons might end up covered in liquor. Therefore, the bartender keeps the cap end as far away as possible.
Bartenders shake drinks to chill, dilute, and/or mix them. There are some shaking rules to help make the best drinks, but the over the shoulder rule is just to keep customers dry.