The French call it l'esprit d'escalier, stairway wit. The witty thing you should have said that occurs to you only as you descend the stairs at the end of the evening. As a novelist, I find that I have these staircase thoughts about each of my novels, even though my first novel was published in 1995, which is getting longer ago all the time.
Sometimes it is a question of reading a small item in a newspaper, or hearing a story, or learning one more little factoid about an arcane subject you were keenly interested in a few years ago because of what you were writing at the time. Sometimes it’s an inspiration a few years past pub date sparked by something in a novel, or in a movie. Sometimes it is just a spontaneous thought about a wonderful detail that would have been just right to illuminate further some moment in a novel, some aspect of a character.
With True Confections, I keep learning candy facts and lore. I regret very much that I didn’t know how Milk Duds and Black Crows each got their names while I was writing the novel. I completely forgot about Chunky. I didn’t go into the history of the Goldenberg Peanut Chew. I didn't consider a whole little episode that I can envision perfectly now about Alice playing fast and loose with requirements for Kosher certification of the candy.