Let's say you want teach the computer to determine between good and bad products and give it the following dataset to learn:
[![diagram with dataset. 0 to 50 are 0. 52 and 74 are 0. Remaining values from 51 to 100 are 1][1]][1]

0 means the product is faulty, 1 means it is OK. As you can see, there is a strong correlation between the X and Y axis. If the measured value is below or equal 50 it very likely (~98%) that the product is faulty and above it is very likley (~98%) it is OK. 52 and 74 are outliers (either measured wrong or not measured factors playing a role; also known as noise). The measured value might be thickness, temperature, hardness or something else and it's unit is not important in this example So the generic algorithm would be 

    if(I<=50)
        return faulty;
    else
        return OK;

An overfitting algorithm would be:

    if(I<50)
        return faulty;
    else if(I==52)
        return faulty;
    else if(I==74)
        return faulty;
    else
        return OK;

So the overfitting algorithm would misclassify all products measuring 52 or 74 as faulty allthough there is a high chance that they are OK when given new datasets/used in production. To an external observer this classification would be strange but explainable knowing the original dataset which was overfitted.

For the original dataset the overfitted algorithm is the best, for new datasets the generic (not overfitted) algorithm is most likely the best. The last sentence describes in basic the meaning of overfitting.

  [1]: https://i.sstatic.net/PnPoA.png