"Writing, before it is anything else, is a way of clarifying one’s thoughts. This is obviously true of forms such as the diary, which are inherently solitary. But even those of us who write for publication can conclude, once we have clarified certain thoughts, that these thoughts are not especially valuable, or are not entirely convincing, or perhaps are simply not thoughts we want to share with others, at least not now. For many of us who love the act of writing—even when we are writing against a deadline with an editor waiting for the copy—there is something monastic about the process, a confrontation with one’s thoughts that has a value apart from the proximity or even perhaps the desirability of any other reader. I believe that most writing worth reading is the product, at least to some degree, of this extraordinarily intimate confrontation between the disorderly impressions in the writer’s mind and the more or less orderly procession of words that the writer manages to produce on the page."—Quote from Alone with Words.
The rest of the article is worth reading too.
One note of several I could make: The disorderly impressions to be confronted may well be in our notebooks or electronic files. In fact, I think that's where they are most likely before we can confront them properly.
1. See also Darwin on collecting notes with the intention not to publish.