The ref() function references another dbt model from a query. dbt replaces the call with the full relation name depending on the environment and deduces the execution order: the referenced model is built first. This mechanism produces the dependency graph and the lineage.
Example
select * from {{ ref('stg_clients') }}