@sanderunive We use an algorithm called BM25. To understand how exactly that works, check out this blog post: Practical BM25 - Part 2: The BM25 Algorithm and its Variables | Elastic Blog.
Here's a similar post with an answer that can shed some light on this as well: Some beginner questions on optimizing search results - #2 by Carlos_D.
Things like how often a term shows up in a single document, how often a term shows up in ALL documents, and length of individual fields that a term appears in are all a factor in relevance scoring.
"Relevance" is a relative concept; whether a document is "relevant" or not for a particular search is entirely context dependent, and differs from use case to use case. This is why we provide our relevance tools, like weights and boosts. You'll need those tools to ensure that the "right" documents are considered relevant for your use case.