SLAC National Accelerator, a National Lab that Stanford happens to run, employs about 1,600 people. They don't necessarily need to interact with students; other national labs are run by corporations (e.g., Sandia is run by Honeywell).
Stanford has a massive medical system, including an adult and children's hospital. They are teaching hospitals, and so part of the point is to train medical students and residents, but they also need all the staff of a regular (actually, top-of-the-line) hospital: doctors, nurses, techs, porters, billing, payroll, etc.
On top of that, Stanford also has a massive research program funded by grants from (e.g.,) the NIH, NSF, and DOD This requires people to actually do the research (heavily-funded profs rarely teach, plus postdocs and research scientists) and support it (animal health techs, machinists, etc). There is also a lot of bureaucracy involved in getting, doing, and accounting for that work. It certainly depends—in part—on grad student labor, but it's also not directly linked.
All in all, big research-intensive universities do a lot more than classroom education and the staff sizes reflect that. I'm sure there's room for improvement (I work at one and purchasing is currently a nightmare), but staff/students is not a great metric.