See also music, art, game design/development, content creation on sites like YouTube and Twitch, blogging, etc.
Part of this is simply due to competition; there was stacks of it before the internet got big, and there's probably a thousand times more now the internet has become normalised. The barrier to entry to writing a book or becoming a writer is extremely low in the grand scheme of things (well, if you have the determination/patience to finish), so enough people do that you're spoilt for choice there.
Add this to how challenging the marketing/sales side of running a business is by default, and how trying to make a sustainable income as an author or creator is basically being a sole trader/entrepreneur, and well, it's not too surprising that most people don't do particularly well from it.