Good writers seek stretches of time when their minds can become caught up in the writing and when they are somewhat unaware of their surroundings; their minds are living in the writing.
Mark Twain used to go to a small gazebo in his sister-in-law’s field to write without interruption. Ernest Hemingway composed in a second story room in a building near his house in Key West, accessible by a rope bridge, so he could write uninterrupted. Anne Morrow Lindbergh wrote in a trailer parked in her back yard for many years.
Some situations are more conducive to flow than are others. A quiet background helps. That could mean complete silence or the sounds of nature such as a recording of ocean waves or bird sounds. A writer needs to be able to hear the words in his mind, and sometimes he needs to hear the words aloud. Libraries can be good places to write first drafts; so can picnic tables in the back yard.
A noisy background can also be conducive to flow providing the noise continues at about the same degree of low noisiness. Many writers prefer to write in coffee shops or diners with the background chatter of customers and waiters. A vacuum cleaner or hair dryer on in another room—just left on, with no one using it—can help writers to focus. So can classical music.
It’s the interruptions that make writing difficult and end flow.
For writing a first draft, flow can be important. For revising, flow can be important as well, but it is usually less important than it is for composing a first draft. For editing, flow is usually not important.