Yes - but they start accumulating wealth in their early 20s. That gives them at 10+ year head start on the average physician who finishes paying off their debts at ~35.
Software engineers aren't $200k+ in debt at 32 either.
If you are an average salaried software engineer, you can accumulate more wealth than a doctor if you invest at recommended rates. The break even point is somewhere around 60-65 years of age.