|image courtesy Leslie Sigal Javorek, via Creative Commons 3.0|
According to language maven Richard Lederer, the phrase predates Lewis Carroll's famous book.
"Charles Ludwidge Dodgson," Lederer writes, "best known to the world as Lewis Carroll, popularized the Cheshire cat in his children-of-all-ages classic, Alice's Adventures in Wonderland (1865). The Cheshire cat in the story gradually faded from Alice's view, its smile being the last part of the animal to vanish.
To grin like a Cheshire cat goes back before Carroll, and the source could be Cheshire cheeses, which were at one time molded in the form of a cat.
Another theory contends that the cat grins because the former palatine of Cheshire once had regal privileges in England, paying no taxes to the crown."
(confession: we had to go look up palatine. Wikipedia says it means "a historical territory of the Holy Roman Empire, a palatinate administered by a count palatine." Um. Okay. Faraday's still scratching his head on that last explanation!)
Sources: Richard Lederer on Jewish World Review and Wikipedia