In high school, I started doing documentation for computer-related tasks, mostly because my teacher at the time told me my skills would be more valuable1. In college, the job I had working in an engineering computer lab also involved documenting various systems administration activities I started doing2. Even in my first post-college job, I ended up writing a fair bit of documentation, mostly for internal use. The writing that some people know me for was the stuff that was prominent on phoneboy.com in the late 1990s and early 2000s: FAQs on Check Point FireWall-13.
This post is not about what I've written, it's mostly about why, and it's actually pretty simple: it's so I understand whatever it is I'm writing about.
Sure, that isn't how I started writing. It was because I wanted to convey something to someone and I didn't want to have to explain it multiple times. Which of course never quite works out the way you hope but it does help reduce the number of times you're asked about it, as well as the quality of the questions you get back.
I've noticed, over years and years of rinsing and repeating this process, that once I take the time to actually write it down in an effort to explain it to someone else, I usually learn whatever it is I'm writing down to the point where recalling it is pretty easy. This only works for relatively simple tasks and concepts. For the more complex topics, it's more of strong mental pointer to whatever it is I wrote so I'll know where to look when it comes up.
However, I've also noticed that in the last several months, as I've experienced some new health issues, I've started sharing them with the Internet. Many people don't care or are even turned off by this, which doesn't bother me. What it has allowed me to do is to better understand my condition and take steps to improve it.
Bottom line: The writing I do outside of work is for myself. If someone else happens to benefit from that, all the better, but it's definitely not a requirement.