The setting of a story is the basic location of events, while the theme is the overall message of the story. If the theme deals with elements of darkness, a cheerful, sunny location isn't likely to be appropriate. For instance, Edgar Allan Poe's works usually deal with the darker side of humanity; his stories are usually set at night or in stormy weather. The same could be said for novels like Frankenstein. Stories that deal with lighter subjects tend to have brighter, happier settings. Look at most fairy tales. Of course, fairy tales are also a good example of how the change in a setting can help us see the theme. A princess locked in a dark tower rescued by a prince and taken to a bright, gleaming palace helps us see the message of the story.
As the title of the story suggests, the setting is mainly one of the cars on a commuter train from Manhattan to the suburbs. The very commonplace nature of the setting makes the incident more nightmarish. The viewpoint character can hardly believe what is happening to him. It seems like a bad dream. The entire story has a dreamlike quality about it.
It was time to go home, time for a drink, time for love, time for supper, and he could see the lights on the hill--lights by which children were being bathed, meat cooked, dishes washed--shining in the rain.
What brings the nightmare into this familiar suburban setting is the madness of the antagonist, Miss Dent. She doesn't belong here. She has brought her own confused world into Blake's orderly world and created chaos.
"I've never been here before," she said. "I thought it would look different."
She thinks it looks shabby. Blake is not a wealthy business tycoon, but one of the smaller cogs in the great wheels of commerce. The fact that it doesn't look as posh as she imagined it may contribute to her sparing his life. He seems less like a rich aristocrat abusing a poor working girl.
What will Blake actually do about this incident? He cannot tell his wife, and he probably cannot report Miss Dent to the police without having to explain why she did what she did. Blake is lucky that he will be able to keep this a secret in a community like Shady Hill, where everybody knows everybody else's business. Miss Dent has dissolved into the multitudes who inhabit this great megalopolis, but she could turn up again at any time from out of nowhere.