I am applying to an MS in CS program. I know most people apply for AI and Machine Learning. Does a university have a fixed number of slots for AI students? Or is this true for the Ph D program and not the MS program?
Admissions are always limited, because students consume finite resources: classroom space, lab and computing equipment, advising and grading time, funding, and more generally faculty attention. Even in online professional masters programs, admissions are restricted to students with a certain expectation of success, because failing students make the program look bad. For research oriented MS and PhD programs, money and advising time are probably the most limited resources.
Different departments approach the limits differently. Some define strict quotas in advance, depending on number of faculty and available funding levels. Others (like my department) have softer quotas, which are influenced by prior belief that specific students will accept admission offers. Others accept every student with a high enough GPA and GRE scores, and let the students fight each other for advisor attention. But there are always limits.
This depends largely on the admissions policy of the program to which you are applying. If the program directly admits candidates to the PhD program, and has them go through the master's program first, then there is quite likely a cap on the total number of students who can be admitted. On the other hand, if the master's program is functionally separated from the doctoral program—that is, if students can apply to the master's program without any connection or expectations for applying to the doctoral program until later—then it is much less likely that admissions will be limited.