They are invited based on their placement at the previous World Championships, World Rankings, Seasons Best scores, etc. You probably already know that. From the top three in the World, the host nations decide which two each of them will compete in, but none of the top three skaters/teams from the previous Worlds will meet each other before the GPFinal, if they qualify. Same for 4-6. I'm pretty sure after that, the six host nations send out their invites to the skaters based on how many assignments they originally receive from the ISU (although some might be host nation invites?). Host nations obviously get preference on the three skaters or teams they want to skate at their own events.