While fiction gives us stories about events that never happened, the setting for most fiction is a specific time and place. When a writer sets his or her characters against that backdrop, the reader gains insight into that time and place and into how characters respond in that particular context. We often can learn about history by reading about how imagined people feel and behave. We can often learn a great deal generally about a time and place as we see the "big picture" that emerges in a story.
Two very different examples that come to mind are The Great Gatsby, by F.Scott Fitzgerald and The Kite Runner, by Khaled Hosseini. In the former, the Twenties in the United States are captured in the stories of the characters, with the excesses of the wealthy, the lives of the poor, and the ever-present American Dream that all the characters aspire to. In the latter, we see a picture, past and present, of Afghanistan and how it has been ravaged time and again and of an immigrant community in the United States. In both novels, we see the sweep of an era or eras and can understand the human responses to the setting in which the characters find themselves.
It is my opinion that history courses benefit from the reading of fiction because we can identify so much more easily with fictional characters. History really is a story that is woven together through a selection process with the purpose of allowing us to "see" something we could not otherwise available to us, and that is the purpose of fiction, as well.