How did Tolkien invent new languages?J. R. R. Tolkien was a scholar of philology and linguistics, specializing in Anglo-Saxon and other Germanic languages, so he was pretty concerned with the verisimilitude and grammatical completeness of the languages he created (as well as the aesthetics).
The Wikipedia article on Tolkien's Elvish languages goes into a lot of detail of how he created his Elvish languages.
Words and soundsHe appears to have admired the mythological traditions and languages of Germanic, Celtic, Baltic, and Finnic peoples, while he mostly avoided words and sounds from Romance (Latin-derived) languages. Correspondingly, a lot of his the roots of his Elvish-language words come from those real-world language families.
For example, Ilúvatar, the creator god of the Silmarillion, is clearly derived from the Kenning-like Germanic roots All-Father. The celeb- morpheme which appears in several Elvish names (Celeborn, Celebrimbor) is probably derived from Silver (again, a Germanic root). On the other hand, a lot of the suffixes and phonotactics of consonant clusters are derived from Finnish, as Tolkien himself explained in the passage quoted here.
SyntaxIn terms of syntax, Tolkien's invented Elvish languages fall in broad typological categories that are well-attested in real human languages.
For example, Quenya is described on Wikipedia as an agglutinating language with a lot of suffixes and SOV order; Turkish would be a typologically-similar real-world language. (Finnish is also similar, but usually has SVO order.)
Sindarin, on the other hand, appears to be a fusional-to-analytic language. Tolkien said its syntax and morphology was based on that of the Welsh language (Brythonic subfamily of Celtic).
Historical RelationshipsTolkien intended the Elvish languages to represent a language family descended from a common proto-language, which had presumably diverged due to the Elvish diaspora across the continents of Valinor and Middle Earth. ("Sundering of the Elves" as Tolkien put it.)
The Wikipedia article on Elvish languages again comes through with a nice illustration of the regular sound changes among the Elvish languages, very similar to those in the Indo-European languages (such as Grimm's law.
One thing that we don't see much evidence of in the languages of Middle Earth are the sorts of areal features and extensive borrowing among unrelated languages that seem to characterize real human languages. This is not too surprising given Tolkien's background. He was very much influenced by the Indo-European language family, which is perhaps the archetype of the tree model of historical linguistics:
From the onset, Tolkien used comparative philology and the tree model as his major tools in his constructed languages. He usually started with the phonological system of the proto-language and then proceeded in inventing for each daughter languages the many mechanisms of sound change needed.