Does publishing books help with PhD admissions?
Certainly it would be a plus---even a good technical blog or a nice portfolio of posts on SE can be helpful. It speaks to your level of sophistication and interest in the subject. One can tell a lot about scientific maturity by reading someone's expository works---it betrays the way one thinks about things and can also give an indication of scientific awareness.
At least some of your letter writers should be familiar with the book and be impressed with it. If you're lucky, some faculty at places you're applying may also be familiar with it as well.
For me, publishing with a well-known publisher would make a little stronger first impression (the publisher can lend the book a little credibility), but really what the letters say about it, or how the book reads if I decide to look at it myself (which is much easier for open access books) is much more important. (Note: open access books or online notes can actually get wider circulation in academia than traditionally published books.)
This is not to say that writing a technical book is a good way to get into a PhD program. It takes a lot of effort that could be put to other use if your only goal is to get a PhD. But if you already have one written, it would be silly not to mention it.
Fundamentally, PhD programs are in the business of admitting and training academics, researchers, and teachers. In that sense, writing a technical book aimed a larger market won't be a substitute for a demonstrated interest and ability in scholarly work and research.
That said, publishing a "trade" book is solid sign that you can write well enough, that you're organized enough to complete a major project, and that you have a mastery of the technical field you have written about. These are all things that a potential graduate program will care about it.
For context, I wrote two technical books before I applied to graduate school and I think it was part of what helped me get accepted to a engineering program without an undergraduate degree in technical field. I did not use the book writing sample and I don't think anybody at any PhD program I applied to read it. In my case, the book compensated for what might have otherwise been a hole in my CV.