In the final battle, Scarlet Witch pinned Thanos upon which he told Corvus Glaive to...
"Rain Fire!"
... which seemed to open fire like Gatling guns and nearly injured all parties fighting. However, it quickly shifts and started firing towards the clouds where Captain Marvel was emerging from.
Why did the Sanctuary II focus its attack on Captain Marvel?