Unions and Seniority
It's a better system than any alternative. I've worked (flown) under both. The subjective (political) system breeds favoritism which has nothing to do with competence.
If you think the seniority system is unfair and you're qualified - look for a flying job elsewhere.
Unions have never figured out how to deal with de-regulation. They have done a superb job with technical aspects of aviation, but union leaders, by and large are politicians, not pilots and serve themselves, not their craft.