Cosine similarity measures the cosine of the angle between two vectors, effectively comparing their direction, making it useful for high-dimensional data.