Writing helps you to put your thoughts on paper or on screen, therefore allowing you to get the thought off of your mind, so you dont have to think of it so much. They always say the best thing to do with stressful events, is either confront them, avoid them, or write them down and forget them. It helps to keep you centered and calm and allows you to feel as though you are expressing your feelings instead of keeping them in.
On another note, you can release so much more from writing. This allows you to be you and speak what you like. Good thing is no one has to know if its about them or not. You can write whatever whenever and however you like. Its also a great way to keep your mind occupied from what is going on in your life.
Im not sure if that answers your question fully but I hope it at least helps and if you have anymore questions please feel free to ask, or feel free to express your opinion!