A theme is a central idea of a work of literature. Themes usually involve some sort of moral, lesson, or message that the author wishes you to come away with after reading the work. Often there is a main theme and several sub-themes implicit in the novel, short story, or play.
For example, in Jane Austen's Pride and Prejudice, the theme is learning to overcome one's preconceived ideas about the motives of other people. Both of the main characters, Elizabeth Bennett and Fitzwilliam Darcy, must learn to overcome their class prejudices: Darcy, against those of lower classes, Elizabeth her beliefs about the elite. As for prejudice, Darcy must learn that Elizabeth, despite her kooky family, is her own person. Elizabeth that Darcy has laudable intentions despite appearances to the contrary.
Sometimes a theme is immediately apparent. In Shirley Jackson's short story, "The Lottery," we know early on that ritualized brutality is abhorrent. But in longer works, it may take some time to absorb all the themes an author intends. For example, in To Kill a Mockingbird, Harper Lee's themes include tolerance, guilt, and coming-of-age in America.
A theme is the main idea or lesson that the book is based on. its the lesson that the author is trying to get across or the topic that is discussed in the novel. For example, to kill a mockingbird is centralized on the theme of growing up and coming of age.