The setting affects the theme in a major way it contributes tothe plot and the characters of a story so much that without a setting, there will be no plot for the story to be held.
by giving a time and a place the book is taking place in affects the lessons that can b learned from the main character in the surroundings IE setting and lesson learned being them