DH, who is in charge of training newly qualified teachers as part of his position as head of the science department (and gifted ed coordinator, but there isn't that much to coordinate, as usual) would say the necessary ingredients are as follows:

A) excellent grasp of the subject matter

B) a normal personality (no mental illness, alcoholism etc).

The rest is commentary. As in, how to then be a good teacher of said subject matter can be taught and learned as long as these ingredients are present.
If someone does not have an excellent grasp of the subject matter after having picked your subject(s) of all the subjects available to study and having spent four years on it (this is Europe, so that's all you do at university after all), something is clearly wrong. If you are only one step ahead of your students yourself, you will never have the confidence and self awareness to understand a struggling students mistakes, or a gifted students probing questions, and will never be able to admit to a mistake or to having to look something up.

And as long as you have a normal personality and aren't looking at teaching as your or anyone else's salvation or as going back to school where you feel safe from the big bad world or as a way to be able to not be challenged because everyone in the room is smaller and weaker than you are, you will learn to be a professional, how to support children, and not hurt them, not feel you have to take them down a peg if you feel challenged by them, not react like a disappointed lover and lash out if they don't act the way you want them to.

I've seen a lot of teachers who lacked one or both of these attributes, and it's a disaster every time. But if both attributes are there excellence is achievable.