The setting of a story is most often used to symbolize a particular idea that the writer wishes for us to have of the place and the people residing within it.
For example, in To Kill A Mockingbird, Lee Harper's description of Maycomb is meant to symbolize the parochial and insular nature of the town and with it, the people who live in it. It contributes to the meaning of the story because it explains in part why the people in Maycomb had the pejudices they did and why they reacted in set ways to events that transpire in the novel.
Similarly, in A Midsummer Night's Dream for example, the setting of the play in the Athenian forest is significant in signalling to the audience that they were to further suspend their beliefs about reality and accept that fantastical events could take place in such a magical setting.
The term setting does not merely refer to a physical/geographical location in fiction or drama. It more widely refers to the atmosphere/ambience which governs the plot/narrative, and may also influence/mould characters in action.
The moorlands in Emily Bronte's novel, Wuthering Heights or the Egdon Heath in Hardy's novel, The Return of the Native is obviously much more than a place where things happen. The place in each novel becomes an abiding force to make things happen, a place invested with a will or design of its own.
Porphyria's lover waiting all alone indoors on a stormy & rain-soaked evening in Browning's dramatic monologue, Porphyria's lover must have been influenced by the setting which includes the indoor space as much as the storm and rain.
The cul-de-sac, North Richmond Street, in Dublin & the dark muddy lanes in its surroundings play a very significant role in Joyce's story, Araby.
The setting in stories not only create the environment but the atmosphere the characters are placed in and the mood of the story.
For example if a character was placed in a foggy swamp in the middle of the night the character will automatically be disoriented ad frightened which will make the reader automatically be put on edge, anxiety ridden, because they do not know what's going to happen next. All of this because of the setting of a dark foggy swap.
An example from a well known piece where setting was the key of the story would be Lord of the Flies. The island that the children where stranded on created mystery and anxiety for the reader as well as challenged the characters morality.
The setting often of a story , drama , novel and short story , often foretells the incoming events , and it symbolizes the tragic gloom .In Porphyry's Lover ,the setting well serves the the catastrophe .
It was a stormy night. Porphyria’s lover was waiting in his room. He was picturing the unexpected presence of Porphyria, who was separated from him for her higher social rank and status. The lover was watching the fury and violence of the storm that tore down the tops of elm-tree and ruffled the water of the lake. He was feeling lonely. Just then Porphyria stepped into his cottage and it was a great surprise to the lover.