It is no accident that workers in some countries earn much more than workers in other countries. Workers in wealthy, high-wage countries work with more physical capital, they have more education and training (human capital), and they work in a more efficient and flexible setting. Those are the fundamental reasons why wages are high.
The theory of compensating differentials explains why fun jobs pay less and dangerous jobs pay more. As wealth increases, workers become more willing to give up money for safety and so job safety increases over time and is higher in wealthier countries than in poorer countries.
Unions can raise some workers’ wages, often at the expense of other workers, but unions are not a fundamental reason why wages are high in wealthy countries.
At least two kinds of discrimination occur in labor markets, statistical discrimination and preference-based discrimination. Markets tend to break down discrimination over time, because profit-seeking employers are looking to hire the most productive workers. Nonetheless, this force is imperfect and often discrimination persists.