I once read a definition of humility that has stayed with me: true knowledge of yourself.
Gaining true knowledge of oneself is a lifelong process. Hopefully we grow in knowledge and self-understanding as life progresses. At any given time, though, humility is about knowing our strengths and weaknesses and being honest with ourselves about them. It is also about seeing oneself in relationship to others and the earth.
The humble genius knows that they are a genius. They also accept the call to be in what Martin Buber calls an “I-Thou” relationship with humanity and creation more generally.
Confidence is very similar. Confidence probably stems from a sense of worth, which I assume comes from God, one’s parents, Later friends and accomplishments contribute. Confidence hopefully grows over a lifetime, although definitely not linearly.
I think one needs confidence to be truly humble. And one needs humility to be truly confident.