This.
Writing is half the battle—it is a significant hurdle and not everyone can write a great technical book.
But the other half (and I struggle with this mightily) is sales/marketing (and the whole 'business' side). Making it look pretty, getting people to know it exists, promoting it.
Many of the best technical writers I know are not great at the latter, and for them, self-publishing might not be the best approach.