ref_ queries are one of those ServiceNow features that are useful, slightly obscure, and easy to misuse.
They show up when you start from a base table such as task, but need to filter on a field that exists only on a child table such as incident.caller_id.