Take 6 points that roughly follow a straight line, with a little noise. A straight line misses each point by a small amount. A fifth-degree polynomial can pass through all 6 points exactly, with zero error, so on these points it is perfect. But to hit every point it must bend sharply between them, and for a new point those bends can put its prediction far from the true line. The extra wiggles fitted the noise, not the pattern.
This is why models are tested on data they have not seen. Split the data: train on 80% and hold back 20%. A well-fit model scores about the same on both, say 92% and 90%. An overfit model scores far better on training than on the held-back data, say 100% and 65%. The signature is the gap, not the training score, and a perfect training score is itself a warning sign, because real data contains noise no honest model can predict.
Overfitting is not the same as doing badly everywhere. A model that scores 60% on training and 58% on new data has memorized nothing; it is too simple, which is underfitting, and the fix runs the other way, toward a richer model. Overfitting is also a property of the whole model, not of one data point. A single odd value is an outlier, though bending a model to pass through outliers is one way to overfit.
Think of it like this. An overfit model is like a student who prepares for a test by memorizing last year's exam, answers included. On last year's questions they score 100%. On a new exam covering the same topics they struggle, because they learned which answer went with which question, not why. The cure is the same for both: practise on questions you have not seen before.
Core idea. Overfitting is when a model learns the noise in its training data and then stumbles on new data.