Smack has a set of old definitions relating to scent and taste. As a noun, for instance, it can refer to a taste or a flavor,1 and as a verb it can mean to taste or to experience.2 Smack in these senses descends from Old and Middle English forms of the word, and it took several spellings before settling on the modern one by the 17th century.
Modern English speakers know smack primarily as an unrelated word having to do with slaps and sounds made with the lips, while the older smack lives on mainly as the verb embedded in the phrase smack of, which means to resemble, to evoke, or to be reminiscent of. This is a figurative extension of the earlier senses of smack that were synonymous taste and smell, so to smack of something is to figuratively taste or smell of it. The phrase usually refers to negative qualities (this is true of historical instances as well as modern ones), though there’s no logical reason it can’t be used for neutral or positive things.
The earliest known instances of this figurative use of smack of are in Shakespeare (see below for one example), but there’s no way to know for sure whether he was the first person to use the word this way.
But this is worshipful society / And fits the mounting spirit like myself, / For he is but a bastard to the time / That doth not smack of observation; / And so am I, whether I smack or no. [King John, William Shakespeare (published 1623)]
As our King John said, (whether wittily or wickedly, let others judge) That the Buck he opened was fat, yet never heard Masse: so many souldiers have been successeful without the least smack of pietie. [The historie of the holy warre, Thomas Fuller (1640)]
This is said to be the production of dean Swift, and it smacks of his pen, but I cannot believe that he intended it should have a place on ground, consecrated for far other purposes than the loud laugh of the vacant mind. [The Universal Magazine, vol. 95 (1794)]
With an attention to the details which smacks of the Dutch school, the maid is represented with her milk-pail in her hand. [Punch, vol 38 (1860)]
It was not every day that in the middle of civilization the chance came to do something which smacked of mediaevalism—which had in it something of the high adventure of Ivanhoe.[The sins of the children, Cosmo Hamilton (1916)]
The iron broom whisked across China, sweeping at all things smacking of the foreigner or the past. [The Free Lance-Star (1966)]
But while its dim fantasies about Hitchcock and the association of genius with psychosis can be written off as silly, they also smack of spiteful jealousy. [New York Times (2012)]