Doctors getting paid ?

I was told doctors get paid more for performing a c-section, which I had. I got my bill in the mail & its almost $40,000 which of course my insurance is not going to cover all of it. Hypothetically speaking for people who don’t have insurance who have a baby, who don’t care to get the bill situated & are just in that debt for the rest of their lives, how are the doctors making that money from a delivery? I understand they have a base salary. But if they just up and leave the hospital, how does the doctor get money off of it? Deep shower thoughts honestly