It's important to get along with co-workers, and people often make friends with others in the office. Just remember you are at work, not at a club with members who come and go. That means jobs take precedence and getting ahead can be part of that process. And that means competition.
You may think you'd never edge a co-worker out of a position, but when you and a co-worker want the same job, competition enters into it. You may both agree to interview for the job, but now your true nature will be revealed. Who will you decide to be?
Have you revealed secrets in confidence that could now be exposed? Trust is always an issue because even though you "hang out" with a co-worker/friend, you don't know what that "friend" will say to get the promotion or a raise. I worked at a company where two young females vied for the same position. One of the so-called friends became cutthroat and back-biting when the other one edged her out of the position. The one left behind hid her anger but planed her triumph over her friend. Little did the winner of the job over know that her friend had planted ideas in the president's mind, pointing out her mistakes and weaknesses on the job. You may think this would never happen to you, but no one knows just how much a person can hide.
Be careful what you say and to whom you say it. Be careful what you admit. There'a a reason to never say anything negative about anyone at work. Unless you're a psychic, you don't know what the future holds.