k-means finds groups in unlabeled data by repeating two easy moves: give every point to its nearest center, then move every center to the average of its points. Each move can only lower the total squared distance, so the process settles quickly. Where it settles depends on where the centers started.