It's nothing to do with actual ability, though that might be a factor sometimes. It's entirely possible to have someone who is less competent but more extroverted leading people who might be more competent if they stepped up, but are too anxious to do so.