Here's why:
* el médico is the masculine singular definite article "el" + the noun "médico" (doctor).
* él is the masculine singular subject pronoun, used to refer to the doctor.
So, in a sentence, you might say:
* Él es el médico. (He is the doctor.)