I would have never read, or later purchased, the testing goat book for Django if it wasn’t freely available because I would have simply selected another source.
People don’t really do that with fiction because there isn’t 9 million different Harry Potters that are all almost equally good.
A further benefit of having a lot of people read your tech book is that you get more feedback which makes it easier to improve it, and a lot of tech books are really rather terrible until they’ve been heavily edited. And unlike fiction there is often a correct way to do things with tech.