In their fight with the humans, the Borg adapt INSTANTANEOUSLY to the humans' weapons. What is so complex about Species 8472 that the Borg cannot adapt fast enough and fight it? What is further puzzling is that if Species 8472 were really so complex, why is it that a human invention (holographic doctor) can devise a weapon to combat Species 8472? This situation sounds illogical to me.
The problem (in univsere) with the Borg is.....they can't invent. They are all BUT innovative. As they say in those episodes the borg do not innovate, they do not explore they assimilate.
They can modify their technology slightly as we see with the adaption of shield frequencies though. But more than that is impossible to them. They need to assimilate others to make more than only slight changes.
Thus in order to adapt to Species 8472 they would have had to assimilate that species to get their knowledge and get a way to counteract them. But that species was immune to assimilation.
So the Borg were unable to defeat them and thus had to adapt.....they knew they needed something or someone that could defeat an enemy with just improvisation and knew exactly what species had that ability thanks to the assimilated knowledge they had. The one species that was inferior and still bested them with .... innovation. Every single time.
And as for the doctor....despite being a hologram he thought more like a human than a logical state machine. That is because he became self aware and like humans an individual isntead of a collective like the Borg. Thus he also had innovation as an ability like the humans.
Out of universe it makes SOME sense still though. Innovation is usually not a group ability, but one for individuals. For example when a group of scientists or programmers brain storm its ONE SINGLE individual for whom all that knowledge suddenly makes click and he gets an innovation an idea on how to put it all together for a new way to do what the group wanted to do.
And the Star Trek Borg are all but individuals. Thus it makes SOME sense that they have no innovation at all, but can adapt inside the boundaries of their existing knowledge and also the ways to use that knowledge that they have assimilated.