Rowling chose Latin as the language of magic in the world of Harry Potter. The vast majority of the spells we have read and heard are based in Latin, the notable exception being Avada Kedavra.
Latin is a peculiar choice for the language of spells. After the rise of Christianity in the Roman Empire and Europe, Latin become a liturgical language, spoken by the clergy and used in services. It also, as a result, became the language of scholarship and eventually the lingua franca for writing in western Europe throughout the Middle Ages. Philosophers, scientists, alchemists, and the clergy wrote in Latin so they could share their findings and ideas, and preserve them for future generations.
But it was not in people’s minds a magical or secret language. That honor fell to ancient Egyptian, whose writing system was considered mystical and magical. The word hieroglyphs actually means holy or sacred writing, from the Greek heiros meaning sacred and gluphē, meaning carving. Biblical Hebrew was similarly viewed by Medieval Kabalah followers, while on the Indian subcontinent Sanskrit and Pali took on that role.
In Harry’s world the ancient Egyptians are revered for their magical knowledge, as when Hermione says to Ron about his family’s trip to Egypt: “I’m really jealous. The ancient Egyptian wizards were fascinating”. The other language given special attention is the Runic alphabet, also called the Futhark because its first six letters were f, u, th, a, r, and k. This name is actually sensible since the word alphabet in English comes from Greek alpha and beta, the first two letters of that alphabet. But Runes were used to write several related languages in northern Europe, and which is being used at Hogwarts is never made clear.
However, Rowling herself learned Latin in school and spent time studying in France, so Latin must have seemed like a good choice for an ancient tongue that would provide a mystical yet accessible feel to it. And she was right.
Among Harry’s first spells is lumos, used to emit light from his wand. The word lumos is familiar because of words like luminosity and luminescence. Lumus is related to the Latin root lumen-, meaning light, which in turn comes from the Latin word lux, which means light. This spell is deactivated by saying nox, which is Latin for night or darkness.
An important spell throughout the series is expelliarmus, which disarms an opponent. Though not a Latin word itself, it is a combination of the verb expello, meaning to drive out or expel, and arma, meaning weapon. The addition of the –us ending makes the spell sound more Latin to modern ears.
Vital to Harry in Harry Potter and the Prisoner of Azkaban and later is the Partronus Charm. In Latin and during the Roman Age, a partonus was a protector or defender, and came to mean a patron in the same sense that we now use the word in English. The spell is activated by saying “expecto patronum”, which sounds great when Harry says it. But expecto is not a Latin word, and is likely related to the Latin verb expectorare, meaning “expel from the chest”. This word is based on pectus, meaning chest in Latin. And patronum is actually right. In Latin nouns change form depending what they are doing in a sentence. An object noun (the partonus is the object of the verb in that it is what the verb is acting on) adds an “m” when it is like patronus, ending in a –us. So Rowling remembered her declensions when she created this spell.
The Unforgivable Curses are similarly based on Latin, except for Avada Kedavra, which has a separate story.
Rowling uses Latin for the basis of most of her spells. A quick check of a Latin dictionary will reveal what her inspiration for each was, and a little bit of Latin study will go a long way toward understanding how she created the individual names. Latin may be a dead language in our world, but it is alive and well in Harry Potter’s.