In the UK, software engineers outearn doctors. Doctors used to have trouble securing work visas when there was a limit on the number of visas issued. When the limit is hit, the applicants will be prioritised according to the number of 'points'. Higher salaries command higher points.
https://workpermit.com/news/uk-tier-2-visa-cap-exemption-doc... https://www.imgconnect.co.uk/news/2021/04/nhs-doctors-pay-sc...