>>45824185Because it happens. There is a small part of randomness in their choices but it also only take into account (in case of a double typing) the type shown in the raid to choose their mons. For example, Thundurus is Flying/Electric, when the Flying type is the one shown, the AI will take Water mons without any hesitation even though the Electric type is the thing you should fear in that case. They also disregard resistances and the moveset of the Pokémon. So they can pass, in the case of Thundurus, a Pokémon like Klang which has Power Gem but can take a Pokémon with a typing super-effective but without any STAB move to actually hit super-effective. They can also pass a Ground type when the Flying type is shown just because Ground is uneffective on Flying, even if the Ground type has a Rock type attack in my example of Thundurus.
I also suspect the game to have a "perfect" route in mind and to force the AIs to choose the mons who can deal with the ones in that route. Ever saw a route which can be full of Water mons and you got only Fire/Rock ones and the one you want to take goes first to a Water mon even though the other "less good in your eyes" route doesn't deal as well against your team? I did, a lot of time and that's when I suspected the game to do this, when I saw exactly that route I just described one day. Of course, that "perfect" route isn't perfect at all or everyone with a decent game knowledge and brain would follow it but it feels like the game follow that pattern at least.
And so, when dealing with the AIs, you need to choose the route who has the maximum you can get out of the moves and typing. Taking only resisting or super-effective types won't always work, some Pokémon will spam stupid moves or still get easily KO'ed. Avoiding Pokémon like Lampant, a mid-evolution + with Trick Room in case you already have a TR setter in the team, avoiding non-attacking Pokémon like Comfey who sometimes will only spam After You, etc... (1/2)