Try reading the article: the departments take a loss on each student. (But we'll make it up on volume?) It's the other departments like liberal arts which are cross-subsidizing them. (Which is cheaper to teach, a computer lab or a poetry class?)
Students don't pay departments, they pay the university itself. The university determines the department's budget. So departments will have budgets which allocate the number of professors, instructors and teaching assistants. From there, they determine the number of courses and sections they can offer. And, from there, they will determine how many students they can handle.