KNN is a simple machine learning algorithm that classifies data points based on their similarity. It works by finding the K nearest neighbors of a new data point based on distance, and assigning the most common class among those neighbors as the prediction. The value of K affects the decision boundary, with larger K resulting in smoother boundaries. Choosing an optimal K is done empirically. While simple to implement, KNN has limitations with high-dimensional or irrelevant features in data.