There’s a wealth of information on this topic at – where else? – Wikipedia:
Scientists, specifically biochemists, and martini connoisseurs have investigated the difference between a martini shaken and a martini stirred. The Department of Biochemistry at the University of Western Ontario in Canada…found that the shaken gin martinis were able to break down hydrogen peroxide and leave only 0.072% of the peroxide behind, versus the stirred gin martini, which left behind 0.157% of the peroxide.[7] Thus a shaken martini has more antioxidants than a stirred one. The study was done at the time because moderate consumption of alcohol appears to reduce the risk of cataracts, cardiovascular disease, and stroke, none of which afflict Bond.
Andrew Lycett, an Ian Fleming biographer, believed that Fleming liked his martinis shaken, not stirred because Fleming thought that stirring a drink diminished its flavour. Lycett also noted that Fleming preferred gin and vermouth for his martini.[8] It has also been said that Fleming was a fan of martinis shaken by Hans Schröder, a German bartender, although other sources cite bartender Gilberto Preti of London’s Dukes Hotel as Fleming’s favourite bartender and the originator of the recipe for the Vesper Martini.[9][10][11][12]
A part of Ian Fleming’s James Bond character was based on people in his surroundings. One such influence was his friend Bernhard von Lippe-Biesterfeld, who drank his vodka martini as Bond did, always shaken, not stirred.
Some connoisseurs believe that shaking gin is a faux pas, supposedly because the shaking “bruises” the gin (a term referring to a slight bitter taste that can allegedly occur when gin is shaken). In Fleming’s novel Casino Royale, it is stated that Bond “watched as the deep glass became frosted with the pale golden drink, slightly aerated by the bruising of the shaker,” suggesting that Bond was requesting it shaken because of the vodka it contained. Prior to the 1960s, vodka was, for the most part, refined from potatoes (usually cheaper brands). This element made the vodka oily. To disperse the oil, Bond ordered his martinis shaken; thus, in the same scene where he orders the martini, he tells the barman about how vodka made from grain rather than potatoes makes his drink even better.
Other reasons for shaking tend to include making the drink colder or as Bond called it, ice-cold. Shaking increases convection thus making the drink far colder than if it were to be stirred. Shaking is also said to dissolve the vermouth better making it less oily tasting.[13]
But I always thought “shaken, not stirred” referred to sleeping through an earthquake.