Here’s my experience for Chemistry PhD programs.
For top-5ish programs (Caltech, MIT, Harvard, Berkeley, Stanford, can also include places like Scripps and now Northwestern), they have their pick of the most qualified candidates from around the world. They pick their PhD students accordingly, which means they want to see strong evidence of preparation to perform novel research. That means a strong academic foundation (necessary to develop valid hypotheses and correctly interpret data), and research experience (lab skills, ability to learn on the job, to deal wth adversity/failure, and to synthesize new knowledge and ideas).
The top-5 programs tend to have students from top schools, and some are particularly overrepresented. But that also depends on the size of the undergraduate chemistry program at the school (ie. Stanford has only ~20 chem undergrads per year, not that many apply to PhD programs). More commonly, the students who are accepted have some sort of research ties with professors who are well-known in their field. This is correlated with top universities, but does not necessarily mean top universities. Students from lower-ranked or small non-research universities may do REUs with very reputable labs; there are also very reputable professors at lower-ranked universities.
So how to get into a top-5 program? Solid grades + solid research experience. Research experience is reflected in publications and letters from professors/PIs that say the student was a good researcher. Same goes for getting research fellowships to pay for grad school. Some fellowships are targeted towards underrepresented groups (women, some visible minorities). The top-5 programs do not really have ‘diversity’ considerations for admission. If you don’t have a letter from a well-known researcher, you’ll want a publication in a reputable journal to demonstrate research ability.
Another thing to note is that a ‘well-known professor’ does not always mean one with lots of prizes or a giant research group. Some professors are well-known because they do their bit in the academic community - they serve on journal boards, host conferences, review grant proposals, etc. The academic community is very small and incestuous. You can see a name and think ‘oh I know his/her PhD advisor, that advisor did excellent work and therefore this person must also be a solid scientist.’ Or ‘I’ve seen this person’s papers or heard him talk at X conference. He/she seems like a careful scientist and therefore I trust his/her judgement.’ On the flip side, there are also infamous professors (who also tend to be at top schools)… people tainted with scandals/rumors/bad science - they will also damage the credibility of associated scientists like former students, collaborators, etc. Usually this doesn’t carry down to the undergraduate students since they understand that undergrad students don’t really have the nuanced understanding of academia to know any better.
Outside of top-5 programs (but even within the top 20), admissions become much looser. They’re still looking for ability to do good research, but the quality of applicants (especially from Western countries) is lower, so a very strong GPA with limited research experience may be enough to be admitted.
As for stipends, just a single example - Stanford’s is >$40K; Berkeley is ~$35K. For post-docs, Stanford mandates salaries to exceed NIH minimum; Berkeley follows federal salaried employee minimum wage.
A final note: as much as it’s true that good grad programs will accept top students from lesser-known schools, it’s also important to know that poorly prepared students will not survive a rigorous PhD program. I once mentored a PhD student who had a top GPA, 2 REUs and a research fellowship who was from a very very small LAC with weak STEM programs. Despite being excellent on-paper, the student just did not have the solid fundamental chemistry knowledge and lab preparation to do research. The student had the passion and commitment, but did not have the tools. And it was truly heartbreaking to see because the truth was s/he should have done a lot of undergraduate courses over again, but it was just too late to be able to do anything about it. This student left the PhD program well before candidacy.