When you write to publish, you need to make yourself understood.
When you make yourself understood, you have to make explicit some assumptions that are implicit for you.
When you give those implicit assumptions a form, many times you realize that they are difficult to articulate.
When you articulate them, often times you realize that they can be challenged.
This is why writing is thinking.
Writing for others forces you to surface your inner assumptions, which then forces you to reassess something that was not conscious.