This phrase refers to unlikely companions or allies; or usual opponents banding together. Dictionary.com says it is often used in the phrase “politics makes strange bedfellows.”
Bardwords quotes the phrase from The Tempest Act 2, Scene 2:
“Alas, the storm is come again! My best way is
to creep under his gaberdine; there is no other shelter hereabout:
misery acquaints a man with strange bedfellows. I will here
shroud till the dregs of the storm be past.”
They further say that “although set in different times many of the most famous quotes about life and love by William Shakespeare are still relevant today. Did you know that William Shakespeare is credited by the Oxford English Dictionary with the introduction of nearly 3,000 words into the language?”
Encyclopedia.com notes that the expression “adversity makes strange bedfellows” was an early 17th-century saying meaning that difficult circumstances will bring together very different people. So I guess Shakespeare can’t take all the credit. And the full phrase “politics makes strange bedfellows” was a mid 19th century proverbial saying. Wikiquote says the phrase “politics makes strange bedfellows” was used in print by American essayist and novelist Charles Dudley Warner. The phrase appeared in his 1870 book My Summer in a Garden.
Equating adversity with politics sure fits these days. Maybe it always has.