I swear that I have been hired for jobs several times mainly because I have a book on the shelves of book stores by a publishing company they recognize. Don't underestimate the value of having an O'Reilly book to your name.
I'm pretty sure that 90% of the books published by O'Reilly and the like are written by consultants as self-promotion, with no expectation that they'll provide a return on their own. Presumably O'Reilly has adapted to take advantage of this fact.
It's also possible that writers start out really excited to make a book to help people, and then in the end all they have left is the self-promotion out of it once their publisher didn't do anything to promote it.
Look, I don't doubt that an ORA book is a credential. I just doubt that it's a cost-effective credential. A prominent Github project will serve most people just as well as an ORA book.