How does laboratory funding and money management work in grad school? there's something I've been curious about regarding the funding of labs in graduate schools. I imagine it's different in different schools, but there's probably a most common scenario.

How is money managed for a lab? My most naive understanding is that the lab mostly gets money from grants. But what happens when a lab runs out of grant money? I assume the school doesn't want a major lab supporting several students and postdocs just folding, so I'm guessing they lend them money.

For example, the are several common facilities at my school that charge the lab when students use them (electron microscopes, etc). I know we're short on money right now, but I've never heard of anyone not being able to use the facilities. I would definitely make sense to me that the school internally lets a lab rack up debt to them with the expectation that it'll be paid back when they get grants in the future.

But how does it work for peoples' paychecks, and non-school payments? I know our lab also has a p-card. Does that mean we may be racking up debt externally?
Bad things happen when a research group runs out of money. If it's a short-term cash flow problem (for instance, having to meet payroll in the aftermath of the US government shutdown of 2013), the university should be able to provide short-term funds to cover the gap. But this can come at a cost:


It may not be possible to order necessary supplies.
Travel may be restricted.
Normal operations (usage of expensive equipment, etc.) may have to be partially or totally curtailed.


However, if it's a long-term, structural problem—for instance, because the group has grown faster than grant funds to support the group—the consequences can be much more dire:


New students and postdocs can't be hired.
Support for undergraduate students (REU's, and similar programs) get cut.
Students may have to take on teaching assignments to receive their stipends.
Recently assigned students may be asked to switch into another research group.