You pay the agency only for the service upon its completion (usually it is a percentage of the candidate's annual salary), and if there is an internal staff of recruiters, the company pays everyone a salary, bonuses, and other perks provided by the company.
In addition, a big advantage of a technical recruitment agency is that with its help you can solve all your tasks at once, without delegating this to a lot of your employees, but simply by ordering several services relevant to you.
What else to read