Tolkien first invented the various languages like Elvish and Black Speech, and then wrote 'Lord of the Rings' to provide a world for those languages to 'live in'
Tolkien’s mother awakened a love of languages in her son by teaching him Latin, French and German at home. He entered grammar school and continued learning many other languages throughout his life. He had a deep knowledge and appreciation of languages – both modern and ancient and one of the languages he could write and speak was Old Norse.
His fascination with language and culture is evident throughout ‘The Lord of the Rings’ which is an epic high fantasy novel that he wrote between 1937 and 1949. It is the second best selling novel ever written with 150 million copies sold.
He invented several well thought-through languages like Elvish (including Quenya and Sindarin), the Dwarfish language Khuzdul, Entish and Black Speech. Tolkien’s stories were not written to include the languages he invented. He developed the languages and then created his stories around those languages.
"The invention of languages," he wrote, "is the foundation. The 'stories' were made rather to provide a world for the languages than the reverse." Here are some examples of the magic Tolkien created with his invented languages: Black Speech: "Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk agh burzum-ishi krimpatul—One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them" Quenya: "Elen sila lûmenn' omentielvo—A star shines on the hour of our meeting". Dwarvish: "Khazâd-ai-mênu!—The Dwarves are upon you!"