usually writing is associated with communicating with others. There is always supposed to be an audience for the text. But sometimes that audience can be just yourself.
I've already written about how writing can be a tool for thinking. Putting those thoughts into actual words can gibe them new perspective and concrete meanings.
Writing can also be a tool for learning. Being able to write about something requires certain amount of knowledge about the subject. And it's also great way to make you remember the things better.