I recently met with a student who expressed frustration that employers post positions even when they have an internal candidate in mind. Although my student prepared and did his best in the interview, he had no chance of being selected. The practice may not seem fair, but if you regard the situation from the perspective of employers, you realize it makes sense. Employee referrals reduce the cost of hiring, improve the quality of candidates and result in lower turnover rates. That's a win for hiring managers who have no desire to go through the process multiple times.
Hiring and onboarding cost time, effort and money, and employers want to select candidates who have the required abilities and are motivated to do the job. Instead of feeling frustrated, you may want to start developing connections that can make you one of those referred candidates. Referrals often come through employee referral programs, but you may also be referred through former employees, interns or clients engaged with your target employer.