I made a simple proposition to my PI: I'm skilled. I'm at least 3x as productive as a grad student (and I could make 10x in industry). You pay me 3x, and I'll work on your projects some of the time and mine some of the time. Give me (a realistic and workable level of) freedom, a living wage, and treat me right, and I'll stay here as long as I can. He agreed.
It takes an experienced PI to understand just how much more value a staff scientist gives over a early-stage postdoc or grad student, which are cheaper. You get stability, expertise, and experience for what is ultimately not that high a price tag. I myself have watched my PI undergo this evolution. I have been with him 10 years, and in the early days, he was all about summer students etc. Now he knows that you simply cannot get real work done with cheap, temporary labor.
I could get higher-paying or more prestigious jobs elsewhere. And I do believe I could cut it as a PI if I wanted. But I really, really value this arrangement.