"Rarely do they pay more than 1/3rd. E.g., as I have already posted in this thread, Mike Bloomberg gave $100 million to Johns Hopkins, and a founder QUALCOMM recently gave $133 million to the Cornell technical university [...] So, again it's Joe and Mary paying for the university."
Wait, is it Joe and Mary footing the bill? Or Mike Bloomberg and Irwin Jacobs (the Qualcomm founder you mention)?
And I contend that when the NSF, NIH, or other government agencies give contracts to universities that are in part executed by grad students, that's labor bought and paid for. Not a handout (in part) to foreigners.
I just know what the heck I'm talking about.
As I wrote in this thread over and over, it's US citizens, via gifts or taxes, e.g., taxes from Joe and Mary, that is paying for most of any education in a well known US college or university. So, in particular, there's no way a foreigner is paying his/her way; the foreigner is getting an education mostly paid for by US citizens.
For the graduate student who gets a stipend for work grading papers or working in a lab for a prof, that's mostly just make work. I've done it as a grad student, and I've hired it as a prof. I will say that when I was teaching calculus at a Big Ten school as a grad student I was earning my keep.
The NSF wrote into its grant contracts that students must be supported as a way to get more STEM grad students, not because the NSF wanted those students to contribute to 'research' but because the NSF economists did a calculation to see how to increase STEM graduate degree labor in the US labor market.
So, sure stockholders of United Technologies, GE, Microsoft, Cisco, Intel, etc. like the idea of the NSF generating more STEM Master's degrees, but Joe and Mary can see that their tax money is not getting their children through college but is getting foreign students through grad school to compete with their children should they manage to get through grad school. So Joe and Mary have a right to feel ripped off.
"Not a handout (in part) to foreigners."
No, that basically is what is going on, and because the NSF insists so, and so insists because the NSF wants, as I explained, to participate in 'US national manpower management', i.e., flood the US with cheap labor, in STEM fields and not just research.
Mostly it is just not in the economic interest of any country to be giving away high end education to foreigners.
If you will read what I wrote, then you will see that there were students from India in a US Midwestern university. They were not wealthy. And at the time there's no way they could have been paying their way. Net, in US universities, even in undergraduate programs, a major fraction of STEM students were from foreign countries, especially India and Taiwan. In simple terms, they were on scholarships of various kinds.
Further, again, yet again, this time just for you, over again, no student in a well known college or university pays the full cost. Rarely do they pay more than 1/3rd. E.g., as I have already posted in this thread, Mike Bloomberg gave $100 million to Johns Hopkins, and a founder QUALCOMM recently gave $133 million to the Cornell technical university being built on Roosevelt Island, and this story is standard all across US colleges and universities. At a research university, expect that a professor will get about $500,000 a year from NSF, NIH, etc. About 60%, 300,000, will go to the university as 'overhead'. The remaining $200,000 will cover the professor's salary, travel, equipment, supplies, etc. And a little will go for graduate students. So, again it's Joe and Mary paying for the university.
Net, students don't pay the full cost. Instead the full cost is paid by gifts and taxes, taxes, e.g., for Joe and Mary who are still having a tough time paying for their own children to go to college. Some of the taxes go quite directly to the institutions, e.g., all the state schools in NY, MD, CA, the Big Ten, etc. A lot more money goes from tax payers to the universities via NSF and NIH.
You mentioned DARPA: There were old rules that the US DoD could not fund work at universities. Long much DARPA (ARPA) work was so 'confidential' that it could not be done in universities. But clearly, e.g., with some of the DARPA Challenge projects, e.g., at CMU and Stanford, some DARPA funding is making its way into universities. Still I doubt that a major fraction of DARPA money goes to universities.
Yes, the situation of the NSF flooding the US with foreign STEM students is more extreme in graduate programs. But the NSF money that goes to students is not really because the research projects need the student's labor! No, the money is because the NSF demands that students be supported because the NSF wants to flood the US labor markets with STEM students with graduate degrees. Maybe you believe that you worked hard for your research assistantship, but, really, the NSF, NIH, etc. mostly just want you to add to the US STEM worker pool to keep down costs to US industry and the US 'military-industrial' complex.