Legolas stayed to fight because of only 1 reason.
He and his mercenary group were not the ones facing the forces of the Beast Coalition head-on, the Nak fleet stationed in Planet Kronic Beam Ring took the brunt of the attack and they had what it took to withstand it.
Planet Kronic Beam Ring was a strategic planet of the Nak State, it had a lot of investment and importance to it, including a focus on its security.
The only reason why this valuable planet was not fortified enough to resist a Calamity Grade assault was because it was located at the heart of Nak State.
The Nak State was confident that no enemy dared to attack it.
The Nak State was confident that no enemy dared to invade this deep.
Common sense deterred any enemy from courting such foolish death, not even the Ackermann State dared take on a mission of such difficulty.
Clearly though, the Beast Coalition fell outside this range of common sense.
BOOM! BOOM! BOOM!