Correct me if I am wrong, but the Hobbit was written as a children's book. After reading it, fans wrote to Tolkien asking for a sequel, which became LotR. I believe Tolkien's experience in the war led him to write LotR as a darker book. I love how once in a while Tolkien lets humor slide in though.