Maybe it would be helpful to trace the path of an academic in the US through their education and career, noting how they might be funded along the way. Differences with those coming up in other systems will have to be left to those familiar with those systems.
We'll skip through so-called "K-12" education and undergraduate education and start with graduate school. Students are admitted to Ph.D. programs usually with a tuition waiver and a stipend. Tuition and the stiped are guaranteed by the admitting institution at some level, but where the money comes from varies.
One source is teaching. Having graduate students help with teaching (serving as recitation leaders, graders, teaching assistants, sometimes even as lecturers) is seen to serve a dual role: Helping deepen the graduate student's education in the subject but also to help fund the graduate student. The tuition paid by the students in the courses the graduate student helps teach often will not flow to the graduate student directly, but through the department in which the graduate student is studying to offset the stipend. Graduate students will teach in their first year or two.
Another source is grant funding. This pays for the student as they join a research group and begin to work on funded (or fundable) projects. Some external funding may be awarded in the name of the student directly, but often the funding is to the principle investigator that oversees the research group the student has joined.
A student in a well-funded lab may only have to teach the minimum amount, getting most support from the lab's grants. A student in a poorly-funded lab may have to pick up teaching even several years into their studies.
Generally though the view is that the student is working for their stipend in parallel to doing their thesis work. When things are going well, this is the same work.
A graduate student might also pursue a master's degree only. Very often this is more of a professional degree (even if taken in a program alongside those pursuing Ph.D.s) and the student will pay graduate tuition themselves and not be awarded a stipend, similar to students pursuing those more widely recognized as professional degrees (MBA, law, medicine). Sometimes, a student admitted to a program in pursuit of a Ph.D. does not succeed towards candidacy to pursue a Ph.D. (doing poorly in classes or candidacy exams, or choosing not to move forward). In this case, they might be awarded a master's degree for their work to that point, or with a little more work.
Those getting their Ph.D.'s then typical do post-doctoral work. This is even more of a hybrid between further education and a straight-up job. Here, there are few options for funding: Either the PI has grant funding out of which they can pay the post-doc, or the post-doc has applied and been awarded their own funding.
Finally, a post-doc that pursues a tenure track faculty position at a research university will apply for jobs. If they get interviews, and offers, and accept an offer, typically they will negotiate a "start up" package which includes some combination of money and equipment with which to equip and stock their lab, and to hire people (students, technicians, or post-docs) to help them begin their work. Depending on the discipline, the department, and the new hire, this can be quite a lot of money (hundreds of thousands of dollars, easily, into the low millions). The idea here is that this is "seed" money after a fashion. The new hire is expected then to write for grant funding, eventually bringing in enough grant money to pay some fraction of their own salary, to pay for further equipment and supplies, and to pay salaries or stipends for lab personnel. Start up money is usually the only money that universities pay to support research. Everything else (and, to be honest, even probably some of that) comes from grants.
What fraction of the lab head's salary comes from grants depends. Nine-month appointments are typical, and the faculty needs only draw "summer salary" to cover at most 3 months of salary. At academic medical centers where there is no undergraduate program, faculty teach much less, salaries are higher, and more of the salary is meant to come from grants or other external funding (eg, government contracts).
Now, about the start up money that comes from grants--here's the kicker that seems to not be well known despite its prevalence. How does the university pay for the start up? Well, it has some money from endowment. This is significant at the old, large, prestigious private universities, like the Ivy League. It might also cross-subsidize from tuition. But also, a lot of money flows through the university via overhead. Overhead is money the university takes off the top of individual grants for administering the grant, providing space, support staff, utiltity service, and the like. What percentage this is, and what it covers, is negotiated periodically between the university and the granting agencies, but in general it isn't unusual for it to be over 50%. Overhead is also referred to as indirect costs, or simply indirects. (I see this is briefly mentioned in some of the comments to another answer).
What mix of endowment income, gifts, direct grant funding, indirect charges, and tuition goes into paying for any given thing at a university is deep, dark, magic. Someone might be able to give an answer, they might even be willing to give an answer, but I'm not sure how much credence I'd give any set of numbers passing through such a tangled skein.