This is a great question—
First off, it’s important to know that “correlation does not imply causation”. This means that even if two events coincide, it doesn’t necessarily mean one caused the other. Typically another variable that causes them is involved.
For example (it’s silly but bare with me), if a study found that there was a strong correlation between ice cream sales and shark attacks at a number of beaches sampled, you might conclude that an increase in ice cream sales leads to more shark attacks because they want to eat people full of ice cream! That is FALSE. The increase of ice cream sales and shark attacks are due to warmer temperatures i.e. people enjoy cold treats in the heat and sharks come out in warmer water.
So back to to your question... If a community has a lot of doctors as well as high rates of illness (correlation) you can NOT assume that doctors cause illness (causation). Potential reasons why there may be more doctors in that area is because there have always been more sick patients and therefore more need for them to be treated. ....Also it’s highly unlikely for a doctor to specifically “cause” an illness unless they are not following proper infection control protocol (such as disinfecting surfaces and instruments people touch between visits). They typically keep the place as sterile as possible to limit the spread of infections!
Hope that helps :)