Everything linguae says is correct. The additional bit of the system to understand is that the actual teaching (of undergraduate courses) is done by "Adjuncts", who are holders of advanced degrees, but on contract (ie, not salaried employees of the institution) for each class.
Adjuncts generally earn poverty wages, and exist in a state of profound financial and existential insecurity. Universities won't hire any individual adjunct for more than a certain number of classes per term (lest they become a full-time employee, to whom they owe health insurance and other benefits), so adjuncts usually need find employment with more than one institution, or else a secondary job to make ends meet (I met folks, teaching at universities you've heard of, working in restaurants and fast-food on the side).
Even worse, universities (by and large; maybe there are honorable exceptions I've not heard of) will not consider their adjuncts for promotion to tenure-track positions. Even worser, other universities likely won't consider you for tenure-track if you've adjuncted elsewhere - so, even if you've managed to publish some interesting papers on top of your teaching grind (I'm coming from a Humanities background, where that's more possible than in STEM), the people who know you won't hire you, and you aren't able to claim your association with [Prestigious Institution] because the stench of "Adjunct" hangs about it.
(The additional point about community colleges is correct. You will often find better undergraduate instruction - from imminently qualified professors - there than you will at brand-name universities. However, some community college systems are also starting to adjunct their classes, as a cost-saving measure.)
There's a concept of "Elite Overproduction", that I think explains the phenomenon:
https://en.m.wikipedia.org/wiki/Elite_overproduction
This is how empires fall.