As 20Driver says, airlines love seniority because it effectively removes competition from the pilot job market - and they have even managed to get pilots believing its good for them.
Ability could be measured using all sorts of things. Total flying time and experience as an initial sift, after that quality of applications, performance reports from current captains, interviews, exams - there are lots of possibilities.