For any kind of academic application (from graduate admission to professor position), recommendation letters have a major impact on the outcome. The basic idea is understandable: discovering what others think about the applicant. It can help the review committee to decide about the applicant.
However, recommendations letters cannot be statistically reliable. For instance, when all recommendation letters of an application are highly positive, this cannot guarantee that all colleagues think highly of the applicant. Instead, it can be the result of only a few friendships.
In a typical example, if someone has three socially close friends (including current colleagues, coworkers, past professors), then, his applications are always supported by strong recommendation letters. For example, one could have conflict with his entire university, but having close social connection with three persons who can recommend him.
So, why are recommendation letters relied upon so highly, given these limitations?
UPDATE: I do not mean friendly recommendation letters. I mean influence of friendship on a professional recommendation letter. As an another example, Applicant A who has good relationship with 20 professors of his department is an ideal academic with professional relationships at workplace. BUT applicant B who has serious conflicts with most of his colleagues (professors of his department), but having only three friends among his department professors will get better recommendation letters. Those three professors will write recommendation letters based on the applicant strengths by ignoring his weakness in the light of their friendship.