To add to which, the people who are most likely to get visas to move to much richer countries tend to be the ones that start off in their own country's upper middle class (allowing them to tick all the right educational boxes to become software developers or nurses, or at least have savings to pay people smugglers).
They can still be materially a lot richer and often enjoy many other lifestyle benefits from moving overseas even if they have to drop down the status ladder and forget about owning land and having servants, but it does make the decision a bit more of a tradeoff than a salary comparison might suggest. The option of moving isn't really there for the people who are so poor there's no upside to staying in their own country.