There are some overlaps between subject matter and theme, but there are also distinct differences. Don’t feel bad about being confused!
Subject matter is the topic the book or poem discusses. Even while telling a story, there will usually be something that the story is about. For example, in To Kill a Mockingbird, racism in the South is one of the subject s. Childhood and racial justice are also the subject matter. These are topics that the events and characters of the book revolve around.
A theme, on the other hand, is the message the story or poem is sending. You can think of it as a moral message. It is a life lesson, taught by the action of the book. It is related to the subject matter. For example, we learn the theme of the importance of empathy in To Kill a Mockingbird, and the theme is largely conveyed through the novel’s unique subject matter.