In Germany(already a wealthy country) doctors move to Switzerland for better pay and better working conditions too.
It’s also very expensive to move internationally. Visas can cost up to $10,000 alone, so I doubt that so many people actually leave developing countries for developed ones.
There are also tons of people who would never move countries because their family and social circle is in that particular place or they want to make their country a better place.
I also think many people move back home from overseas to their home country, bringing their improved skillset with them.