Academia is not a monolithic entity. In some fields, it is almost impossible to do relevant research without proper equipment and enough people capable of working with said equipment. In others, all one needs is to poach enough talent and assemble them under one roof, and when a government is really, really interested in advancing their technology, they may offer very cushy conditions. Some people make their choices based on that alone: maybe the research potential would suffer a bit from the stifled competition and fewer top notch researchers in the immediate vicinity, but this may well be a difference between scrambling with the job security and finances and possibly being rich, as in not even upper-middle class rich. Diverting resources specifically towards economic and technological growth and sparing no expense there while the rest of the country remains poor for a while is a well-established role model by now, especially in Southeast Asia.
Of course, personal factors play a big role in that. Family ties, background, even climatic preferences are all relevant. But the main thing developing countries lack is well-established intellectual traditions in modern fields of research, which is an obstacle one can overcome. It is a bit similar to organizing a movie night where nigh everyone's attendance is conditional on enough of their friends going as well.
Simply put, developing countries are often willing to put relatively more resources in science and tech than developed ones. They would buy top-notch equipment, let people work in their old collaborations, offer great funding, all as long as the researchers bring in knowledge, and train new people to make these high-tech facilities work. And there are people eager to learn, work, and improve their communities, too.