'Grue' is said to be a color that is green if we first observed it before time X, and blue if we first observed it after time X. Goodman argues that the sentences 'All emeralds are green' and 'All emeralds are grue' are both inferences we can make from the observation that all emeralds are green before time X. His riddle undermines our ability to distinquish between lawlike generalizations (objects with mass attract towards each other, i.e. gravity) and accidental generalizations. (all ravens are black, i.e. we may find a white raven some day). A more detailed explanation is in the linked Stanford Encyclopedia article.
The comic portrays a fictionalized account of how he thought of the idea. His observations about loyal wives would not support his generalization that his wife is a loyal wife, since she may actually be a loyal wife who changes into a cheating bitch after time X, just like the object that changes from green to blue.