A recipe a computer can follow
An algorithm is a list of steps that turns something you put in into something you get out. A recipe is the classic example: take these ingredients, do these things in this order, and you get a cake. Computers need the same thing, only far more precise, because a computer cannot guess what you meant. Every step has to be spelled out, including what to do when something is missing or unusual.
Algorithms are everywhere in ordinary business software. Sorting customers by name, adding VAT to a price, checking that an email address has an @ sign, finding the shortest route between two addresses: each of these is an algorithm. Most of them are so simple and reliable that nobody thinks about them. Everything a computer does, from showing a web page to running an AI model, comes down to algorithms carrying out steps.
Two kinds: written rules and learned models
It helps to separate two kinds of algorithm, because they behave very differently.
The first kind is written by people. A programmer decides the rules: if the order is over a certain amount, ask for approval. If the invoice is late, send a reminder. These algorithms do exactly what they say, every time. You can read them, test them and explain any result.
The second kind is learned. In machine learning, the part of AI where computers learn from examples, programmers do not write the rules for the task itself. They write a learning algorithm that studies thousands of examples and produces a model, a bundle of patterns stored as numbers. A spam filter works this way. Nobody listed every trick spammers use. The filter learned what spam tends to look like from many marked emails.
When people complain about "the algorithm" on social media, they mean the second kind: a learned model that decides which posts you see.
How a learned model differs in practice
A written rule handles exactly the cases its author thought of. Give it something new and it either fails or does something silly. A learned model is better with messy, varied input, such as free text, photos or behavior, because it has seen many variations. That is why AI can sort customer emails that are worded in a hundred different ways.
The price of that flexibility is predictability. A learned model can give a different answer to two inputs that look almost the same to a person. It can be very confident and still wrong. And it is hard to point to one line and say "this is why it decided that", because the decision is spread across millions of numbers.
So the two kinds have opposite strengths. Written rules are clear but rigid. Learned models are flexible but harder to explain and control.
Where algorithms go wrong
Written algorithms go wrong when the rule itself is wrong or out of date. A pricing rule that forgot a new product category, or a discount that stacks in a way nobody planned, will repeat the same error on every order until someone notices. Because they run fast and without tiring, a small mistake can spread widely.
Learned models go wrong in quieter ways. They copy patterns from their training data, including unfair ones. If past decisions favored some groups, a model trained on those decisions will tend to do the same, which is called bias. They can also drift: a model trained on last year's customer behavior may slowly get worse as habits change.
In both cases, the fix starts with the same habit: check the outputs against reality, regularly, and keep a person able to overrule them where the stakes are high.
Choosing the right kind for the job
A good test is to ask whether you could write the rule down on one page. If you can, and it must hold every time, a written algorithm is usually best. VAT, approval limits, payment terms, invoice numbering and access rights belong here. Being exact and explainable matters more than being clever.
If the task needs judgment that is hard to put into words, such as "is this email a complaint?", "does this photo show a scratch?" or "which customers are likely to leave?", a learned model is usually the better fit.
Many good systems combine both. A learned model reads an incoming order and suggests what it is, and written rules then check the amount, the customer's credit limit and whether approval is needed. The AI handles the messy part, and the rules make sure the things that must always hold still hold.
What it means for a small business
A small business does not need to write algorithms to benefit from them, but it helps to know which kind is behind each tool it uses. When a system is built on written rules, you can ask the supplier exactly what the rules are and expect the same result every time. When it is built on a learned model, ask how it was tested, what data it learned from and how you can correct it when it is wrong.
When you plan automation, sort your tasks the same way. Put fixed business rules into ordinary software or settings. Use AI only for the steps that need reading, sorting or judging. And wherever a decision affects a customer, an employee or money in a significant way, make sure a person can see why it was made and change it.