means that
people who would not normally associate with one another may become allies when they face a common difficulty.
also
Politics makes strange bedfellows.
Two rival shopkeepers worked together to protect their street from flooding. Adversity makes strange bedfellows.