@neuralreckoning It depends on the exact setup, but what can happen is that grants are a (financial) loss _for the Department_, but an overall good thing for the university in terms of prestige, employed postdocs and doctoral students, publications, overall budget, expected future grants, etc. etc.
And few universities are without a line of liquidity to cover the short-term loss for overhead (tuition fees, endowment profits, government funding etc.).