Let's suppose you're trying to hire a star STEM researcher. For our purposes, define "star" as someone who is roughly top 10% in his or her department at a good research university. Although assistant professors are hired in a very competitive process, the success rate for hiring stars in good (but not the very top ranked) departments is (by definitions given above) only about 10%.
Let's suppose you wait a while to do your hiring. Look only at researchers who have already been professors for 5-10 years (i.e., at other schools), and have a significant track record of grants, papers, citations, etc. It seems plausible that at this stage of career (late assistant and early associate professors) one can pick out top 10% candidates with reasonably high accuracy.
Suppose that, on average, researchers in the top 10% bring in $400k more per year than the average professor (e.g., one additional NIH grant). This generates about $200k per year in additional overhead return to the university, which is much greater than the salary bump required to bid such a person away from their home university. If the difference in startup cost between hiring a new assistant professor and someone with 5-10 years experience is, say, $500k, then it would take only a few years to recoup this cost. The numbers have to be adjusted for different fields (in physics the overhead differential might be less, like $100k per year), but the expected return still seems attractive if you can keep the researcher for at least 5 or possibly 10 years.