There's a difference between a friend and a work colleague or neighbour. You're right in that work colleagues tend to fade away if you change jobs, as do neighbours if you move house. A friend will stay constant wherever you might be living and working.
They are rare. I doubt I've had more than 2 or 3 at any one time, and friends too can fade away for various reasons. Your best friend tends to be your partner, if you're lucky, and they tend to hang about! None of this means you have to be lonely though, even if you're single: I enjoy chatting to my neighbours and hanging out with them. I liked spending time with my work colleagues too. Even strangers can be fun to talk too, if you make the effort. Having said that, I am aware there is a loneliness epidemic which affects the elderly more than any other group, and I'd argue that loneliness is hazardous to your health.

Not the person I wanted to have cancer, but I'll take it.