There is nothing inconsistent between collaboration being (very) important and it happening only or primarily in very small groups.
Mathematics isn't like particle physics. You don't need billion dollar accelerators, with a huge support staff. Paper and pencil will do, though a good library also helps a lot.
The size of collaboration groups in math is increasing a bit, I surmise, because it is easier now to communicate. I grew up in a time when postal mail and travel/visiting were the only viable options. Now we have the internet. And before my time international mail was very slow and unreliable. I've collaborated with people from four continents, actually.
A lot (most?) of math collaboration is face to face around a table. Often it happens in a coffee lounge in a university department. A whiteboard to sketch out ideas, perhaps. But a lot is just a couple of people sitting down and one mentions an idea they have and the other makes some suggestion about how it might play out. This is much harder in a large group. Even at a conference, if someone brings up an idea to a large audience, the most likely thing is that one or two people will approach the speaker afterwards to share "thought". It doesn't become a large group "huddle". The coffee table might now be a zoom screen, of course, but still only a few people for the most part.
This is, I think, driven by the intensely internal nature of pure mathematics. I wouldn't predict that math would ever be done in a group of hundreds (thousands) as happens at CERN, for example.
Another factor is that it is harder, I think, in math to "divide up the work" with different members of a large group contributing different things. One may have a large overall goal, but no path to carry it out other than very intense focus at a very small part until that gets resolved, giving some insight into what the next steps might be. That isn't quite as true in computer science, and collaborations tend to be somewhat larger there.
One reason for the importance of collaboration in math is that when you work strictly alone it can be difficult to know what the currently important questions are. What is worth pursuing. Those sorts of discussions can, and do, happen in larger groups. But the follow up is more likely to be only a few, especially interested, people who are willing and able to do the deep dive.
So, essential collaboration doesn't necessarily mean in large groups.
I also question, not that it is especially important here, the classification of math with the sciences. The methodology is completely different and the nature of proof (math) vs. evidence (science) is profound.
In thinking about this again overnight, I'm reminded that every mathematical (almost) collaborates widely, but with our, possibly, long dead mathematical ancestors. Nearly every paper is based on some things from earlier work that may have set a direction or provided some insight.
And, mathematicians with doctorates can know their "genealogy", which is a trace back through their advisor's advisor, etc. See: https://www.mathgenealogy.org/index.php