Mixologist Varun Sharma at the Comorin bar.
In the 2006 film Casino Royale, James Bond is asked if he'd like his martini shaken or stirred. He says, "Do I look like I give a damn?"
The gambling losses may have triggered this remark because Bond's character has cared very much for how his drinks are mixed. So much so that Bond's contrarian demand that his martinis be "shaken not stirred" is among his best known catch phrases.
How a drink is mixed matters quite a bit. The decision to shake or stir can completely alter the flavour and texture of a drink. Try Comorin x Makery's pickled pom whiskey kit both ways and taste the difference.
Most bartenders use a simple rule to decide whether to shake or stir. Lighter cocktails (where, say, two types of spirits are being mixed) are stirred and heavier cocktails (that contain dairy, egg, juices) are shaken.
Bond's preference for shaken martinis violates this rule and he was taken to task for it in an episode of The West Wing, by another fictional character, President Bartlett:
"Shaken, not stirred, will get you cold water with a dash of gin and dry vermouth. The reason you stir it with a special spoon is so not to chip the ice. James is ordering a weak martini and being snooty about it."
Shaking a drink aerates it and the air bubbles that form give it a frothy texture. Ice chips when shaken into smaller pieces, further changing the consistency. Stirring has less effect on texture and serves more to chill and dilute a drink (achieved faster by shaking, but stirring keeps a cocktail clear).
As with most rules, there are exceptions (like the Moscow Mule, lightly stirred in the glass it's served in) and matters of taste. While most bartenders prefer to stir their martinis, there is a shaken martini variant known as the Bradford.
Never shake a Bloody Mary though. Thin tomato juice is a good reminder for why these bartending rules matter!
Here's Comorin's Varun Sharma on his reasons for shaking and stirring with a demo of the proper technique for both.