k-means clustering is an unsupervised learning algorithm that groups data points into k clusters based on their similarity. The algorithm works by initializing k cluster centroids randomly, then iteratively updating the centroids by assigning each data point to the nearest centroid and recalculating the centroids as the mean of the data points in each cluster. The process continues until the centroids no longer change significantly, indicating that the clusters are stable.