It's called tribalism and it is innate.
Jonathan Haidt has written some stuff on this, see link.
In my view, the political parties exacerbate the innate tribalistic tendencies. I would love to have political parties eliminated, but in the absence of that In think more political parties would help. But if there's one thing the R/D duopoly can agree on, it's that neither wants a viable third party, so it's probably a pipe dream.