AMA (American Medical Association) has successfully lobbied congress to cap residencies at 100K a year, essentially restricting supply. Foreign doctors have to go through a gauntlet of exams, tests, and licenses that keeps market from being flooded with cheaper talent and diluting local doctor salaries.
Software Engineers have failed to unite like this, so the MS+FAANGs and consulting companies have lobbied for free flow of cheap labor under the guise of innovation. There are no board certifications, no licensing exams, and no restrictions on supply. This is why software salaries have been artificially suppressed for two decades.