For most of this decade, the two companies have been the top two smartphone makers in the world by market share, with Samsung usually on top. (Recently, Huawei usurped Apple's number-two spot). The two companies battled it out in court for years, with Apple accusing Samsung of ripping off its ideas and violating its patents. Most of those battles have been settled.
At the same time, Samsung also provides Apple with key components, such as screens and other hardware, for devices including the iPhone and iPad.
For the last couple years, Apple has been placing more importance on its services business, which continues to grow while iPhone sales plateau. Apple CEO Tim Cook said last week in his revised outlook that services generated $10.8 billion in fiscal Q1 and that Apple plans to double the size of its service business from 2016 to 2020.
"We look forward to bringing the iTunes and AirPlay 2 experience to even more customers around the world through Samsung Smart TVs, so iPhone, iPad and Mac users have yet another way to enjoy all their favorite content on the biggest screen in their home," said Eddy Cue, senior vice president of Internet Software and Services at Apple, in a press release announcing the deal.
Apple hasn't announced it yet, but it's largely expected to launch a TV service that combines free and paid content later this year. A partnership with Samsung could help it get that service in front of more eyeballs, including people who might not own Apple phones or tablets.