Spot on Stilton, a point many seem to overlook is that all pilots are expected to achieve and maintain a basic standard that is sufficient for them to command a public transport jet, if they don't then then don't gain the promotion to captain or, if already a captain, they lose that position.
If all qualified pilots** are of the required standard then promotion by seniority is the only way, if some are below standard they get passed over.
The young bloods who think they are the bees knees and promotion by meritocracy is the only way are the very ones who sometimes stumble on a command course.
qualified pilots** = Appropriate licence, sufficient experience, suitability and a required level of competence. You need a tick in every box.