I put the first few chapters of any book on my web site. I try to make them good enough to be enjoyed by very critical readers, but they ARE drafts and I expect to get some negative comments. Sometimes they are very helpful and I re-write the draft.
Then when the book goes on sale I'll take down all but the first few chapters and link to where the book can be bought. They are never more than the first third of the draft. Too much work to put up more, and MAY take away from sales.
As for putting up entire free books. They can take away from sales of the books. But at least as often people will go ahead and buy the book anyway. There are several reasons. One is that some books bear reading over and over again; it's handy have them already. For others it's because to them hard copies have several advantages over ebook copies.
There's another reason for putting up free books. They act as advertising for all the other books from a writer. Especially if the free book is the first of a series.