Overfitting occurs when a machine learning model learns the details and noise in the training data to an extent that it negatively impacts the performance of the model on new data. Essentially, the model becomes too complex, capturing patterns that do not generalize to unseen data.