You've probably seen a shank in golf (that's why you're here). If you're a golfer, you've probably hit a shank. And, in either case, as soon as you experience a shank, you wonder how shanks happen and what causes them so you never have to deal with that pain ever again.
What is a shank?
Plainly speaking, a shank in golf is what happens when a shot is not struck with the club face but rather with the rounded hosel of the club. Hence why the shanks are sometimes called "hosel rockets." You're hitting off the hosel of the club. That means that you're not contacting the ball with a relatively flat surface like a club face. Rather, you're hitting with a rounded object. Since you're almost always hitting with the inside half of the hosel, the rounded ball will fly off to the opposite side side of where you're standing (to the right for a right-handed player).
What causes a shank?
There are a couple of causes for shanks. One can be that a golfer is lunging toward the ball with their swing, bringing the club path to the ball in a way that the hosel hits the ball instead of the intended contact on the club face.
Another is that the posture and medial movement are fine, but that the issue causing a shank is that the swing path coming back to the ball gets off track and not going far enough inside near impact to make sure the club head clears a path through the ball. This can happen by coming "over the top" and casting the downswing out before coming down to the ball. The other is swinging the path so far out and away from the body that the hosel makes contact.
There's also the possibility that the golfer's forearms simply aren't rotating through the ball, leaving the club face open, not turning over around the impact zone and leading to a shank.
How to stop the shanks
If you hit a shank, Step One is to not panic.
There are several easy drills and simulations you can do to prevent the shanks. One is to make sure you have the feeling of your body remaining stable over the ball, meaning your head isn't moving your view of the ball through the swing. You'll want to simulate feeling like the club is moving particularly inside on your swing path.
If you're in the middle of the round and you feel like you need an emergency Band-Aid, line up the ball on the toe and keep swinging. You may toe one or two, but you'll adjust quickly without having to change your swing.