This is a quote that has to do with the nature of relationships and what makes a person or a country likely to ally itself with another. It is saying that people or countries can become allies even if they really do not like each other all that much. As long as they have an enemy in common, they can be allies.
A perfect example of this comes from World War II. In that war, the US and Great Britain (on the one hand) were allied with the Soviet Union. Neither country was friendly with the USSR before the war and they would be enemies again soon afterwards. But during WWII, they were both enemies of Nazi Germany. Because the Soviets were the enemy of Hitler (an enemy of Britain and the US), they were considered friends of the US and Britain.