Athletes go on streaks. In basketball, a player will continue to hoist up ridiculous shots as long as they keep making them (or, sometimes even if they're not). It's called a "heat check." You see a couple of shots go in, you now have the confidence to shoot again, expecting the next one to go in as well.
But these results are skewed. This type of confidence has no foundation because it is built upon the ever-changing landscape of external events. It's difficult to duplicate and even less effective.
Confidence, therefore, is not a symptom (a result of what happens to you), but a choice (coming from within).
This is not a chicken-or-the-egg discussion. You're successful because you're confident, not the other way around. The confident pianist has complete control over the keys. The confident sales representative gets more sales. The confident coach shows us how (and why) we can reach our destination.
But here's the thing about confidence—more specifically—coaching confidence. You can't coach it, but you can take it away. What you can coach is empowerment, trust, and leadership. The great coaches know when to let people fail, but also when to step in and take the lead. They know the difference between humiliating someone and letting someone struggle for their own good.
I'm not sure if there is a formula for building confidence, but I certainly know that one of the keys is doing things you didn't think you could do.
Another thing, confidence without courage isn't actually confidence. Just because you have the required credentials, doesn't make you qualified. You can be confident in your resume, but without a willingness to lose, to be proven wrong, to fail, it means nothing.