there's a lot of americans who want to get into those graduate programs but are discriminated against in favor of foreigners
When I was in grad school (2008-2011), of the 60 people in my program only 5 were American. The vast majority were Indian or Chinese (~50). I wouldn't say there was discrimination, though. The matriculation statistics were interest-based, mostly. A lot of the Americans who received their BS went immediately to industry.
Not really true but white Americans love to say that. Americans are the biggest bullies and and victims.
As a US citizen with a PhD, I didn't experience any clear discrimination in favor of foreign students during grad school.
I think the main reason so few US citizens get PhDs is because PhD "student" (they're actually workers) positions pay so poorly. Make PhD student positions have non-poverty wages and you'll see a lot more interest from US citizens.
On the flip side, I think foreign students experienced a lot of abusive conditions that I could more easily say no to because I didn't have a visa that required me to work at the university. I've seen some of that first hand. I don't mean to imply that there would be no cost to me saying no, just that I wouldn't have to leave the country if I said no.