The standard way to avoid an over-fitting is to use a "validation set". It means that we split the data into two parts. The first part we use to fit (train) and the second part we use to validate.
Let us now assume that we have a huge number of models and we trained and validated all of them and then we chose the model that gave the best predictions on the validation set.
Can it be that we get an over-fitting in this way? In fact we did use the validation set to chose the model. So, we kind of used the validation set in a fit.