Cosine similarity scores two vectors by the cosine of the angle between them, ranging from −1 (opposite) to 1 (identical direction). Because it ignores magnitude and looks only at direction, it is the standard metric for comparing text embeddings, as set out in Manning, Raghavan & Schütze's standard information-retrieval text (2008).
When a vector database finds the passages "closest" to a query, cosine similarity is usually the closeness being measured.