The phrase means something is concise, or reveals its core or essence in a short incident or event. Phrase Finder says Pliny the Elder used the phrase in Natural History in AD 77. As translated into English in 1601 by Philemon Holland, Pliny says a copy of Homer’s poem the Iliad was written on parchment and “enclosed within a nutshell.” A rather ridiculous idea since the poem runs hundreds of modern pages, and parchment – animal skin – would be hard to fold. But whether Pliny believed such a thing existed or not, here the phrase seems to mean something that is very small, not concise.
Shakespeare, who often took themes from the classics, alluded to the ‘something compact’ idea of ‘nutshell’ when he gave Hamlet the line:
“I could be bounded in a nutshell, and count myself a king of infinite space, were it not that I have bad dreams.”
The figurative use of ‘in a nutshell’ to mean specifically ‘in few concise words’ didn’t emerge until the 19th century. Thackeray used it in print in The Second Funeral of Napoleon, 1841:
“Here, then, in a nutshell, you have the whole matter.”
SayWhy picks up on Pliny the Elder, and Wikipedia refers to Shakespeare, but I think Phrase Finder has the best explanation – an origin to the modern meaning.