Well, recruiters are in the unique position of getting to talk to tens (or sometimes hundreds) of candidates a week for any given position, and asking them all a bit about salary usually yields a workable model for the market for any given role.
Some recruiters also have access to data from VCs or from other salary reports (there are a number of good institutions that run compensation surveys - access to these usually costs lots of money). Glassdoor is also a good source of data (sometimes) and PayScale is even better.