Many hours of practice, having a natural talent and a lot of dedication helps, for example,
When I was teaching piano in the 1980's there was this one student who's heart was not into learning music and did not show much progress whereas his sister at age 10 was a natural and loves playing music and showed incredible progress (already advanced; final year) much like other students.
And because of their love and wanting to learn they never failed to consistently do all their homework without fail. I got a lot of praise for that but I always told their parents it's because they are dedicated.
Funny, I found that to be true with musicians in bands as sometimes you find the odd one who simply prefers to put other priorities such as; sports ahead of music and having a show coming up did not seem to change their attitude. Point is; all it takes is one loose cog in the chain to let the rest of the band down.
Other problems I found was for example; a drummer who could not get his mind off the girls in the band, he was always flirting with them. I got too many complaints from the girls and saw first-hand (for example; he deliberately enter their changing room.) I had find a replacement. Another drummer (aged 19) got a 14 year old pregnant, he had to go.
Yet another problem, a guitarist who simply did not have the time to get his performances down pat due to having more dedication to sports and his self-employed floor coverings business. He was always showing up late with the same old excuse. Sorry, I run a tight ship like I said; all it takes is one loose cog in the chain to spoil it for the rest of the band.
I spent all my entire life totally dedicated to music, spent school lunch breaks in the music room and did what ever it took to avoid sports and social events. I hardly had much of a social life and still prefer to work on music rather than hang out at the tavern with friends. My wife is much the same as I.
But there's another cost to all this, the risk of burn-out having to juggle long days along with working at night till early hours of the morning. Sleep, was is that?... (that's what I would always say)!! The other cost is technology; some musicians can be very prejudice and jealous, saying the most ridiculous things. Funny, I never got that response until I decided to change my music direction to from Classic Rock to Pop.