It depends on the airline and its culture. Having been in a legacy carrier and marched up the list to my command which I enjoyed until its ridiculously young retirement age forced me to leave, I am now at a LoCo as a DE TC where promotion is done on experience and ability alone. The selection for command is thorough and uncontaminated by any form of favouritism. There is no such thing as a long-serving co-pilot at my current company (apart from those who fail) because many leave to join legacy carriers or to go to the sand-pit. Nearly all the others enter the command selection process as soon as they have the hours and they gain a command in short order. Mind you, it helps that the company is expanding at 15% per year! It has yet to hit a serious brick wall.
Horses for courses.