We authors write for varied reasons -- to get ideas from our brains to paper because we simply have to, to entertain ourselves and others, to make a living.
I wrote 'stuff' for decades before I decided to get serious about getting books to readers. Thankfully, I have an obsessive comopulsive nature, so once I started writing books I wanted to finish them.
I don't write much beyond genre fiction, but I read, and learn from, a lot of literary fiction. There is no precise definition of a good book, but I think Ernest Hemminway nailed it.
"All good books are alike in that they are truer than if they had really happened and after you are finished reading one you will feel that all that happened to you and afterwards it all belongs to you: the good and bad, the ecstasy, the remorse and sorrow, the people and the places and how the weather was. If you can get so that you can give that to people, then you are a writer."
Ernest Hemingway, "Old Newsman Writes," From Esquire, December 1934