Building relationships is critical if you are planning to be in the industry for any meaningful length of time. There are many developers that I have personally come in to contact with that refuse to make any attempts at developing any sort of relationship outside of basic every day work functions. You can find out who they are pretty easily if you are one actively trying to make connections. My view is that if you are going to be working half of your life you may as well enjoy it as much as you possibly can. Part of what allows us to enjoy life is the connections we make and the sense of community. Even those of us that tend to be more reclusive belong to at least one community. I can think of online gaming communities where even the most anti-social of us can be spotted after hours building lifelong relationships because I did this during high school when I was less social.
I try my best to make lifelong relationships at every company I work for. These connections are not limited to other developers. I have built relationships with other developers, testers, user interface designers, salesmen, and businessmen.
I am using the term relationship instead of connection on purpose to illustrate a distinction between the two. I view a relationship as putting in effort to consistently and proactively build up a connection over an extended period of time. Even if we no longer work together we still keep in touch (and not only when one of us is looking for a job). I have thousands of connections but most of them are people I have met once or twice. I wouldn't count them as relationships. The relationships is what I think we should strive for and value most.
The relationships I have been fortunate enough to forge over the years have benefited me in a couple crucial ways. One benefit is by being able to build relationships with other peer Sr developers that I trust and value opinions of. We are always bouncing ideas off of each other to help solve solutions for problems we may each individually be encountering. Even though I may not work with all of them still it is nice to be able to get another perspective outside of a company for certain situations you may be encountering technically. There have been times where I will encounter a technical problem and I know someone that I have a solid relationship with who has more knowledge in a particular area where there is nobody on my internal team with that level of knowledge or if I just want to get a different perspective outside of the company I will ask them. Another situation that comes up is when I want to bounce a certain architectural design off and get another peers opinion of it.
Another benefit I have seen is when I am looking for a new opportunity. I always reach out to relationships I have first before I ever attempt to find a job on the the open market. If someone you know and trust is working somewhere that you think you could enjoy then ask them about it. The likelihood that they are looking for talent is high. They will be able to tell you all of the pros and cons a company has. If you have a solid relationship built with them they won't hide anything, even if it means they may not get a referral bonus by deceiving you. It is much harder to get a real sense of how a company is until you actually work there and if there happens to be more cons than pros or non negotiables then it will be too late if you wait until you start working there to find them.