Nope, your understanding is mostly wrong. It's primarily controlled by Congress in the form of Medicare limits on residency funding. And to a lesser extent by the management of teaching hospitals. Most of those people aren't doctors.
At one point the AMA lobbied Congress for those funding limits but they reversed position on that years ago.
At one point the AMA lobbied Congress for those funding limits but they reversed position on that years ago.
https://savegme.org/