There are an unlimited number of examples you could use in responding to this statement. It would have been helpful to know what type of literature you are dealing with, but the basic connection and relationship holds throughout.
When Mark Twain planned to write The Adventures of Huckleberry Finn, he was very familiar with the society of the area along the southern Mississippi River. He thoroughly understood the relationships between whites and blacks and between different classes of whites, and his writing draws on that knowledge to add to the richness of the story.
When an author prepares to write a factual biography of an historic figure, research and preparation for the writing will necessarily include analysis of the society and culture in which the subject lived and how those impacted the subject's life and activities.
There are as many other examples as there are written works.