This is a phenomenon known as group polarization or attitude polarization. This occurs in person as well. It’s just what happens when people of similar opinions get together --especially groups that don’t know each other very well. There are numerous theories explained in detail on Wikipedia though.
Perhaps it’s more common online since the internet allows people to connect with just about anyone worldwide. People are able to find communities for even the most niche of topics, and online communities have a tendency to become echo chambers.
How did you realize that, exactly?