Generally in my opinion the number of participants is limited by the size of the dance floor.
In my classes there are 3 to 15 couples, because the room is not that big, but a no. of 30 couples is ok.
I know when I am teaching a class of 3 couples they are happy about these personal advices but I also know, if all my classes are populated badly, I can close the studio. Big classes don't destruct a studio, but help to pay immense room taxes.
How much a pupil can learn in a well populated class depends on at least two things: Does the teacher EXPLAIN well (not only showing things and hoping dancers will copy his movements) and is the pupil indivdually able to grasp information given by the teacher.
Example: When I say "In Waltz please use the heel when a forward step is at beat '1'" in a big group I won't see, whether everybody does it, but if the participants really listened, they know what to do. In case the teacher just danced the figures without EXPLANATION a pupil has no chance to learn the important points in a big group. So an instructor teaching badly has to teach smaller groups.