A junior developer asked me why most of our projects almost never have documentation. Or if there was one, it's either very outdated or missing very important parts. This became an hour long discussion that almost made me miss my ride home. If that didn't sound bad enough, I almost missed my ride to work that morning too. 😅
In summary, I gave the classic It Depends™ answer.
Whether developers write documentation or not depends on a lot of factors. And I mean a lot: time, budget, scope, development pace, willingness of team members, perceived worth of documentation, team composition, team personality, who's working on the code, where the code is deployed, how many deployments are using it, etc. etc.
I told the developer that I too advocated for good documentation, as I too was once a junior developer that needed guidance. You can see that in my past articles here, here and here. But saying documentation is important is one thing. Having someone actually care to write documentation is a totally different story.