They also routinely share the employers range with candidates.
Believe me, if I told an external recruiter I was looking to make X and they sent me on an interview and I got a job offer at 0.5X, not only would that be the last time we ever spoke but wherever I eventually landed would not be using that recruiter or their firm ever again.
I can't think of a job I've been contacted about in the last 15+ years where I didn't know what the salary range was before I even agreed to have my resume submitted.
That's comically naive. External recruiters routinely share candidate ranges with employers.