I would be surprised if students are funding the library to any substantial degree.
Most research universities charge F&A ("facilities and administration")/indirect costs on sponsored projects. This is essentially a "tax" on grant money that is supposed to cover things like utilities, the library, and so on. While the details vary a bit from place to place (and funder to funder), this is often a pretty sizable amount. Yale, for example, charges a bit under 70%, so if you need $100,000 for a project, you'll need to get the funders to pony up $170,000.