A traditional program follows instructions a developer wrote by hand: if this, then that. A machine learning model works differently. It starts out knowing nothing useful, and gets shown thousands or millions of examples — photos labeled "cat" or "not cat," emails labeled "spam" or "not spam" — until it finds patterns that separate one group from another.
Underneath, this usually means adjusting a large set of numbers, called weights, so the model's guesses get closer to the correct answers over many rounds of trial and error. Each round it measures how wrong it was, nudges the weights a little, and tries again. This process is called training, and it's genuinely just repeated, patient correction at scale.
Once training is done, the model is "frozen" and used to make predictions on new data it has never seen — this stage is called inference. A well-trained model generalizes: it recognizes a cat it has never seen a photo of before, because it learned the pattern of "cat-ness" rather than memorizing specific pictures.