The flagship university in each state actually always has some very very bright students. The very elite schools don't accept many students and the admissions criteria are far from perfect so a ton of students who would be good enough for top tier schools end up going to state schools. I know a couple different people who were top of their high school class and within a question or two of perfect on their SATs that happily went to state schools.
Is this still true? Most of the top schools today appear to have pretty generous aid compared to my undergrad, which was a state school. Only exception I can think of could be out of state public schools like Berkeley or Georgia Tech or CMU.
stanford provides need based aid. if your parents’ earnings are high enough to not qualify for full aid, but have financial circumstances that make it infeasible to attend, you get crunched.