On the first count, money, the two companies have been business partners for years now, because Samsung has been in charge of manufacturing the processors that Apple uses in all of its iOS devices. According to Digitimes Research, Apple is the number one reason why Samsung's microchip manufacturing is doing so well, with 80% of Samsung's microchip revenue coming from Apple.
Of course, there have been consistent rumors that Apple is looking to move away from Samsung, and shift its processor manufacturing to Taiwan Semiconductor Manufacturing Company (TSMC), but as yet, those are just rumors. Although, Samsung's contract with Apple is expiring soon, which means those rumors could become fact quite soon.
On the second point, marketing, we would all do well to keep in mind that there is nothing better for marketing than to have a foil. There's a reason why the Mac vs PC commercials existed, and now we see Samsung vs Apple baristas, and even Microsoft is trying to place itself in the game with its new Surface commercials (though no one really takes those seriously just yet.) Rivalries need not be bitter, especially when each company can use the other to stir up interest for mutual gain.