I've read that Tolkien wrote There and Back Again / The Hobbit as a book for his children. Then he started writing what would become The Fellowship of The Ring for his kids, but he quickly realized that the story was taking many dark turns and that he was best served by moving away from writing it as a book for his kids.