By giving the setting at the beginning of a story, it gives the reader an idea of what the plot will look like. If the setting of a story is in a haunted mansion on Halloween night, the reader has an idea that the plot will probably involve ghosts, chasing, capture, etc. Basically any Scooby-Doo movie ever. All in all, the setting gives the reader an idea of how the plot will lay out.
The correct answer is identifying your audience.
The first thing you need to think about when starting your writing is your audience - the people you are writing for and want to read your work. Based on your audience, you will know whether you need to be more or less formal, you will decide on your language and choice of words, your tone, topic, etc.