As I am an administrator, I will offer a more specific view on the pressures of how to fund a student within the context of a portfolio.
Your funding will most likely be classified as one or more of the following funding sources, subject to change at any time:
- Non-Federal (industry or foundation)
- Non-sponsored ("hard money" or university funds)
- Operating budget
Institutions typically have a way of paying students such that there is a pattern. E.g., the expectation may be that the operating budget will pay for first and second years in addition to anyone who is a teaching fellow (teaching fellows are often doing research as well, and may end up "split-coded", i.e., two funding sources). Then the PI is responsible for years 3 and beyond. How the PI pays for the student is their own responsibility. This may entail startup funds (which may be provided by the endowment) or sponsored funding. They may push you to get a fellowship (GRFP or F-series for NIH)
These funds are subject to different funding issues. If you are on federal sponsored funds, it is possible for a project to be terminated. It's not common, but it is a possibility. If you are on DOD funding, this can be because the sponsor doesn't want to continue the work. DOD tends to obligate funding in small increments so that they have this option at the moment they want. NIH obligates funding annually pending progress on the project. NSF is harder to predict. It ranges from one year to the entire project (usually maxed at 5 years).
NIH funding tends to be awarded but cut in certain ways. E.g., NIH has stopped funding inflation since 2012. The salary caps for PIs has not been increased as expected, because they are actually part of the Executive Schedule, and tied to the United States Code that sets federal salaries for the executive branch. You can see how political it will be to increase an NIH PI's salary--many other political roles would be increased as well. This is not the case at other agencies.
In terms of the size of budgets, NIH tends to have larger budgets because of their focus on healthcare. Meanwhile, NSF is frequently cut because they focus on basic research, which does not sell as well to the general public. Think of it this way-- everyone may support the development of lasers (applied research), but few people understand and support the funding of work pertaining to the physics of molecules (basic research). This happens to be the crucial work that results in the possibility of laser development, but such research is harder for the public to understand and support. Politicians run on researching the cure for cancer not describing string theory.
Unfortunately for basic research scientists, there is rarely a major payoff (program income or royalties) from such discoveries. Even when the basic research enables applied research, the profits are made from the applied research and those folks keep a lot of the profit from the endeavor. Furthermore, academia tends to avoid applied research in general as a matter of course. This is one of the reasons that PIs may provide basic research for an industry sponsor who works with DOD on an applied research project. This structure is becoming much more common, particularly for PIs who are otherwise locked into NSF.
If you end up on endowment funds, be advised that the existence of those funds are more volatile. The PIs who were obligated funding by the institution will be first in line to receive remaining funds and new programs will be the first to be shut off.
There is no such thing as a "guaranteed" funding source really, it's more that the university is diverse enough that they feel comfortable guaranteeing your support. Unless you are worried about the overall financial health of the institution, you should focus on your PI's ability to procure funding. You can actually look them up in NIH or NSF's systems to see what they have received.