In my experience, coworkers gravitate towards each other socially because they respect each other's skills. Competence, humility, integrity etc. in your work are a major source of those warm fuzzies.
A talented jerk is a scourge of a project (especially in open-source): the engineering might attract others in the short term, but being a jerk makes long-term interactions painful and not very fruitful.
Brilliant jerks are bad, but engineers also tend to resent politicians.