Is there an upper limit on the number of students interested in a particular specialisation that a university will admit? 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.