What is a theme, and what is its purpose? -CEFR

The fundamental concept or underlying meaning that a writer explores in a book, short tale, or other literary work is known as a literary theme.

Characters, environment, dialogue, storyline, or a mix of these aspects can all be used to express a story's theme.

The main concept explored in the narrative is called a theme in literature. 

Purpose:

Literature can have several themes at once. Finding a tale's theme may help the author create the story and the reader comprehend it more fully.

  1. Truth

Every piece of literature conveys a larger message about the universe and life, either explicitly or implicitly. These undisputed truths about how the world functions—or, at least, how the author has observed it to function—are rarely discoveries; if they were, they may not strike a chord with readers.

  1. Morality

Every tale harbors a moral perspective, whether or not the story overtly advocates a moral resolution. The narrative may highlight a world issue without going any further to suggest a fix or what individuals should do to address it. Every narrative, whether explicitly stated or inferred, raises issues of right and wrong as well as the extent to which our consciences affect or do not affect us.

  1. Unity

The formation of the topic is influenced by the author's selection of literary and stylistic components, such as story, character, narrative style, and symbolism, and the theme serves to tie them all together into a unified presentation.