I guess people mainly write what they're passionate about, and for the same reason they know a lot about those topics because they already spent a lot of time thinking about it.
It's a mix of personal interest and seeking to develop an expertise. It's also a lot of discipline. I wrote more publicly in the early part of my career, but my writing is more company-internal these days.