I can't speak for undergrads, but a huge number of foreign grad students and post-docs are being paid off of NIH and NSF budgets.
I have a grad degree. Certainly I didn't get any help at all, and I don't know any one in my class who got any kind of NSF grants. I studied with someone who got a grant from his govt employer, but he is American.
For example, in my lab every grad students stipend and tuition fee came out of my advisor's grants. Then again in the sciences, if you want to do any meaningful research you have to do a PhD. I was one of the few who was lucky to avoid doing a postdoc (which in most cases is mandatory to try and get a faculty or industry research position). Note that I'd do that PhD 100 times out of 100. Was a ton of fun.