No one's saying it's magic.
This is the same market (or set of markets) that have lifted billions of people out of poverty. If you're arguing central planning does better then I'd love to see some evidence of it, but to my mind the fact that so many companies can coordinate, even across language barriers and legal systems, sometimes hundreds or thousands cooperating to make products, is incredible, and is not going to be beaten by any other system.
At least on average - of course an authoritarian country like the USSR can drag value out of its citizens by force and spend it on the space race, but that kills people and even, in that case, the country itself.
Far better to have cooperation and value exchange based on the demand generated by real people.