An algorithm is a finite list of unambiguous steps for getting from an input to a result. That is the whole definition. A recipe is an algorithm. So is the method you were taught for long division, and the instruction "sort these names alphabetically".
Computers did not invent algorithms and are not required to run them. A computer is simply something that follows them very fast and without getting bored, which turns out to change what they are useful for.
The four things that make it an algorithm
Not every set of instructions qualifies. It needs all of these:
- Definite. Every step is unambiguous. "Add salt to taste" fails; "add four grams of salt" passes.
- Finite. It stops. A procedure that can run forever is not an algorithm for anything.
- Effective. Each step is something the follower can actually do.
- Takes input, gives output. Something goes in, something determinate comes out.
"Find the largest number in this list" satisfies all four: look at the first number, remember it, compare it with each of the rest, keep the larger, stop at the end. It works for ten numbers or ten million, and it works whether a person or a machine follows it.
Where the word comes from
From a person. Muhammad ibn Musa al-Khwarizmi was a scholar working in Baghdad in the ninth century whose book on calculation with Hindu-Arabic numerals reached medieval Europe in Latin translation. His name became algorismus, then algorithm.
The same book gives us the word algebra, from al-jabr in its title. It is unusual for one author to be responsible for two words this load-bearing.
Why the same task has many algorithms
Sorting a list of names can be done by repeatedly finding the smallest remaining name and moving it to the front. It works. On a thousand names it does roughly a million comparisons.
A cleverer method splits the list in half, sorts each half, then merges the two sorted halves. Same result, about ten thousand comparisons. On a million names the first method takes hours and the second takes under a second.
That gap is the whole reason computer science exists as a discipline. Two procedures can be equally correct and differ by a factor that decides whether the task is possible at all. Routing a packet across the internet is a live example: each router has milliseconds to make a decision, so the method it uses has to be cheap as well as right.
How "the algorithm" came to mean something else
When someone says a video "did well with the algorithm", they are not talking about a recipe. They mean a recommendation system: software that decides, for each person, which items to show and in what order.
These systems are algorithms in the technical sense, but they differ from long division in a way that matters. Their rules were not written down by anyone. They were learned from data about what people clicked, watched and skipped, in much the way a language model learns to predict text. Nobody can point to the line that decided your feed, because there is no such line.
An algorithm is a procedure. "The algorithm" is a specific kind of procedure, learned rather than written, ranking things for you according to a goal you did not set.
That goal is usually engagement, because engagement is what the business is paid for. Understanding how a free app actually makes money explains more about your feed than any technical detail will.
Where algorithms go wrong
Three failure modes account for most of the trouble, and none is the machine deciding anything on its own.
The objective was wrong. A system optimising for watch time will learn that outrage holds attention. It is not malfunctioning. It is succeeding at the thing it was pointed at.
The training data carried a bias. A hiring system trained on a company's past decisions learns those decisions, including the ones nobody would defend out loud. The bias was in the room before the software arrived.
Nobody can explain a particular result. For a learned system there is often no answerable version of "why this one". That is a genuine problem when the output is a loan decision rather than a video.
The short answer
An algorithm is a set of steps precise enough that following them cannot be got wrong. It is one of the oldest ideas in mathematics and one of the plainest. What changed is not the idea but the scale, and the fact that we now build ones whose steps nobody wrote down.