The focus of your writing is determined by the topic you are asked to write about. Whether it's a story or an essay, you will be asked to write about a very specific topic. The more specifically your writing relates to that topic, the better your score.
To pass, your writing needs to at least stay mostly focused on the assigned topic. If you bring in details and examples (which you should), you have to make sure you explain how those details and examples are clearly connected to the topic on which your writing is supposed to focus.
In an essay, this means that the end of each paragraph should clearly explain how the ideas of the paragraph help prove/support the main idea of the essay.
In a story, this means making sure that all the details you include are important to the story. If the story is about the time you ate a ten pound hamburger, don't spend a lot of time describing the dog that you saw as you walked into the burger joint - the dog is irrelevant to the story, and you're off your focus if you dwell on it.