In an ideal world, developers write documentation as they're developing. This seems to work really well for OpenBSD and its various project, all of which have some of the best man pages out there.
IMO it works a lot better for software that is aimed at other developers. Writing documentation that is accessible to non-technical users is a different skill.
All BSDs really, and I also want to mention GNU projects, they enforce this well, too. I made contributions to org-mode, and they made it clear that they won't accept a line of code without accompanying tests and, if applicable, handbook adjustments.
In an ideal world, developers write documentation as they're developing. This seems to work really well for OpenBSD and its various project, all of which have some of the best man pages out there.