They are both the default fantasy mythologies of their age. LOTR was the be-all and end-all of fantasy for... bloody ages, actually, in much the same way Star Trek and Star Wars are for sci-fi. Harry Potter is the first fantasy SINCE LOTR that really can be called a 'default' of fantasy that all others are judged by.