You have two separate whereRelation constraints on the User query (meaning two separate where exists constraints with separate sub-queries); whereas the whereHas approach there is only one where exists constraint sub-query and in that sub-query you have two constraints. They are very different because the second exists query is not scoped to the user's company
SELECT * FROM users
WHERE EXISTS(SELECT * FROM companies WHERE company_id = ? AND role = ?)
ORDER BY name;
// versus
SELECT * FROM users
WHERE EXISTS(SELECT * FROM companies WHERE company_id = ?)
AND EXISTS(SELECT * FROM companies WHERE role = ?)
ORDER BY name;