To be invested and generate returns which can fund the university's programs. As I said in another comment, it's a long-term investment, not a spending fund. You don't eat your seed corn.
> In particular, the endowment supports roughly two-thirds of the budget for undergraduate and graduate financial aid, as well as a significant portion of faculty salaries, research, and key programs like libraries and student services.
The returns from the endowment are used to support university programs. The endowment itself is not spent - it's a long-term investment which produces dividends, not a spending fund.
Universities will dip into endowment funds if the returns are worse than expected. They will pretty much never make plans to dip into endowment funds, though.
Money in university budgets is most certainly not fungible. Endowments are for the most part directed for specific uses and cannot be used outside of the restrictions. Education and General (E&G, terminology varies between institutions) includes tuition (only part of the yearly budget) and cannot be used for research. Unrestricted funds are as rare as hens teeth and doubly so outside upper admin.
The “color of money” is perhaps the most misunderstood aspect of university admin but explains so much about how things operate.