Which of the following questions might help you identify the theme of a piece of fiction? How did the conflict(s) resolve, if at all? Who is the main character? What types of literary devices are used? Where is the story set?
The last one: Where is the story set? The reason being is since fictional books may also take place in fictional places, for example, Hogwarts, so, this is how you may be able to recognize the difference.