Words carry their history the way rivers carry silt. Algorithm is a good example, because almost everything about the modern word is an accident of pronunciation.
A name, a place, a book
In the ninth century, a scholar named Muhammad ibn Musa al-Khwarizmi worked in Baghdad. His name means, in the ordinary Arabic way of forming such names, the one from Khwarizm — a region south of the Aral Sea.
He wrote two books that mattered enormously. One explained the Hindu-Arabic decimal system, including the use of zero as a placeholder, to readers accustomed to other numeral systems. The other, Al-Kitab al-mukhtasar fi hisab al-jabr wa''l-muqabala, set out systematic methods for solving equations. From al-jabr — the operation of restoring, moving a subtracted quantity to the other side of an equation — English later took algebra.
Through Latin, badly
When the first book reached medieval Europe in Latin translation, it began with a phrase rendering the author''s name: Algoritmi dixit — "al-Khwarizmi said". Latin scribes, copying by hand, took algoritmi to be a word rather than a name.
It came to mean the decimal calculation method the book described. Middle English borrowed it as augrim or algorism, meaning arithmetic with the new numerals.
Then a second accident. The Greek word arithmos, meaning number, was familiar to educated writers, and the resemblance encouraged a respelling. Algorism drifted to algorithm, with an th that has no basis in the Arabic name at all. The word had been reshaped by a false connection — a process linguists call folk etymology.
Meaning drifts again
For centuries the word stayed close to arithmetic. In the twentieth century, mathematicians working on computability needed a term for a finite, precisely specified sequence of steps that solves a class of problems, and algorithm was available. That definition is still the technical one.
In the last two decades the word has broadened again, into everyday speech: "the algorithm decided", "the algorithm shows me this". Here it usually means something quite different — a large automated system whose workings the speaker cannot inspect. The word has picked up connotations of opacity and power that a ninth-century arithmetic manual never had.
What the history shows
Four processes are visible in this single word: borrowing between languages, misreading during transmission, folk etymology reshaping a form, and semantic broadening as a meaning widens over time.
They are the same processes at work in thousands of English words. Sugar, cotton, coffee, admiral, sofa, lemon and zero all reached English from or through Arabic. Knowing this does not change what the words mean today. It changes how you read a dictionary: not as a list of fixed facts, but as a snapshot of a language still in motion.