Ghost writers are not always credited in books. Is it because they receive money in exchange?
In academic writing, there's a standard that the authors are the sole authors of the text that is upheld by academic institutions, academic communities, and the academic publishing industry (but not the legal system itself). This same standard doesn't exist in the same way in non-academic publishing (or a lot of other media) so not crediting ghost writers is considered acceptable.
(I am aware there are academic books)