The workplace is supposed to be a meritocracy, and as a result, we might expect that more years on the job make an employee a better candidate to advance to the next stage of their chosen career. When somebody has put in the time and the effort with their employer, it can get to a point where this reward isn't just hoped for; it is expected. They believe they deserve a promotion.
However, life does not always work that way, and the logic behind who gets the fancier job title is often more convoluted than more experience = better candidate. Maybe putting a particular person in this position doesn't fit with the business plan, or there is somebody else who the higher-ups believe is simply a better choice. It can be a bitter pill to swallow for anybody who has worked hard with the hopes that they would get promoted, only to see the role go to a colleague. At the same time, it is their professional duty to deal with their feelings and find a productive way to work with this individual. If they don't do that, they are going to face problem after problem.