The enemy of my enemy is my friend.
Businesses don't have friends or enemies. They have competition... They have interests. These interests, dictated by its owners, or in a public company - shareholders. Typically a primary interest is a higher share price and dividends which are driven by company performance, typically measured in earnings. Short term or long term increases can be had by managing these interests differently.
A quick example:
Amazon and Pandora/Spotify compete on selling digital music subscriptions. These companies try to win the market for selling music to listeners. Everything cool? Well not so fast.
Amazon makes the Alexa - and it has music player capabilities through
Amazon Music. But tens of millions of people already subscribe to Pandora/Spotify/whatever and aren't ready to switch. Pandora and other streamers are pervasive in peoples lives across millions of other non Alexa devices. So
Amazon forms a partnership with Pandora so Alexa can play music through both
Amazon Music and Pandora services. This helps
Amazon sell more Alexa's, even if it means they're listening to a competitors music streamer. Their primary goal was to sell Alexa's and now they're succeeding even if it means they're not buying
Amazon Music.
But the greedy folks a year later counting beans determine that while they made billions in selling Alexa's, they want to capture the revenue Pandora is raking in. Now what
Amazon may due is impair Pandora's capabilities and improve
Amazon Music capabilities in an attempt to steer people towards their native solution. These situations can erode over time, and end up becoming legal battles.
Interestingly,now introduce Google Home, doing the same thing with the same companies, now
Amazon and Google become hostile actors not only towards each other, but the fallout starts to impact the entire landscape.
In the beginning Pandora/Spotify and
Amazon were never _really_ interested in a relationship in itself. They're not looking to hang out to watch Sunday football or share stamp stories. They were interested in selling more subscriptions, and devices - and would use the relationship as the means to this end (as angore mentioned initially)