Graduate students are employees of the university. There are usually other unions at universities for employees, and undergraduate students working in universities can sometimes be in those unions as well, but graduate students as employees face some unique circumstances due to their employment and as a result often form their own union.
Traditionally for better or for worse, undergraduate representation comes by way of a student council, with a single person elected to a chair on the larger university advisory council (the structure can be different depending on the university, I'm generalizing).
There’s a distinction in the US between fully-funded PhD graduate students (who receive a stipend contingent upon research/TA work in an employment relationship) and professional/masters students who pay tuition, even though the latter group is also referred to as graduate students.
Note that for instance if you're there with a fellowship and aren't getting a partial RA/TA assignment as well then you're not eligible. I know that some masters students pay for their tuition, so they might not be eligible either since they're not getting a stipend.
Including undergraduates, who are primarily paying consumers, would have muddied the waters. Graduate students are clearly workers under any definition.
Masters programs are typically where you pay tuition and receive training via classes. PhD programs don't have much classwork and instead are positions where students are paid by the university but are expected to perform labor to produce original research.
Hm, here in Hungary PhD students can opt to do zero teaching[0], and also the tuition is 4500 EUR/semester (and students from the EU can apply for grants that covers 100% of tuition). And on top of all this it's possible to work for the university, which apart from the salary also results in the elimination of certain costs (eg. if someone is not employed by the university they have to pay to have their thesis examined and pay for the exam committee or something).
All Ph.D. programs nominally charge tuition, but hardly any students (at least in STEM, don't know about elsewhere) pay it. They get a stipend plus a "tuition waiver".