How did the Asgardians survive? I've been trying to noodle this through for a while now after seeing Avengers: Endgame. At the End of Thor: Ragnarok, the Asgardians are all on Thor's ship looking for new lands.
At the beginning of Infinity War, Thanos attacks the ship and comes aboard. There's been a slaughter and only a few Asgardians are left. Those are either killed directly by Thanos (Helmdal, Loki) or, well, basically Thor, who is picked up by the Guardians of the Galaxy.
In Endgame we find out that there are some Asgardians still alive,
including Valkyrie, the Rock guy, and presumably enough to populate a town.
Where did they all come from? How'd they survive? Did I miss an explanation?
Edit: To be clear, in addition to whatever other Asgardians there might be in the universe (which might have been 50% decimated with the snap), I'm asking about the Asgardians on the ship at the end of Thor Ragnarok.