But compensation is not the only motivator. And in a more equitable society (eg one where illness doesn't threaten total financial ruin), it would be less important.
I worked in a government job that demanded strong technical expertise. We got two kinds of people: those who knew they could make a lot more money in the private sector but took the civilian job out of a sense of duty or a desire for stability, and those who weren't smart enough for the private sector and knew they could get away with half-assing it in the government. The problem was that people with valuable skills and expertise got lumped in with the paper pushers at the DMV every time a politician lined up to kick the "overpaid government workers" football, so Congress wouldn't let them pay industry rates. Result: the "best and brightest" took advantage of lucrative programs like student debt forgiveness, got some good experience on their resume, then left for industry and literally doubled or tripled their salaries overnight.
Plenty of individuals pursue high-paying jobs because the financial security it provides their family [including children, spouse, and possibly infirm parents]; and to pay back the student loan burden that the American institution levies on their best and brightest.