In the United States, Nestle (NASDAQOTH:NSRGY) has little traction in the coffee market. It's the brand that sells Nescafe instant coffee, and the Nespresso, the single-serve coffeemaker you might pass over for a Keurig on your wedding registry.

Globally, though, Nestle has a much stronger brand. That makes it an ideal partner to help Starbucks (NASDAQ:SBUX) build its brand in grocery stores, supermarkets, and other retailers around the world. The two companies have partnered on a deal for Nestle to sell Starbucks brands in consumer packaged goods and foodservice.

That's a fancy way to say that Nestle is making a $7.15 billion upfront payment to obtain the rights to market and distribute "Starbucks, Seattle's Best Coffee, Starbucks Reserve, Teavana, Starbucks VIA, and Torrefazione Italia packaged coffee and tea in all global at-home and away-from-home channels." That includes bags of coffee beans, coffee pods (including bringing Starbucks to the Nespresso platform), and other instant coffees, like VIA. It will not include any ready-to-drink beverages.

Starbucks packaged coffee and K-Cups

The deal will include packaged Starbucks coffee. Image source: Starbucks.

Why is this deal happening?

In theory, Starbucks could build out its own distribution and manufacturing in each country around the world. That's an expensive proposition where it would have to compete with established market leaders like Nestle. This partnership allows the coffee company to focus its resources on growing its core cafe business around the world.

For Nestle, the deal gives the company access to one of the biggest -- if not the biggest -- name in coffee, in multiple markets. This should allow it to leverage the brand, Starbucks' marketing power, and its own distribution network to grab increased market share.

Starbucks is not giving up any physical assets in the deal. It will continue to handle its own manufacturing in the U.S. while Nestle will take that over globally. In addition to receiving the upfront payment, Starbucks will also receive a royalty on whatever Nestle sells.

"This global coffee alliance will bring the Starbucks experience to the homes of millions more around the world through the reach and reputation of Nestle," said Starbucks CEO Kevin Johnson in a press release.

This is good for both companies

This is not a hands-off deal. The two companies have agreed to work together on sourcing and roasting coffee as well as marketing strategies. Ideally, this agreement will give Starbucks a fast way to build its brand at grocery stores across the world which should enhance its cafe business -- especially in countries where it has limited or no presence. Conversely, Nestle gets access to a well-known, top-tier brand that it can plug into its existing systems.

Starbucks will use the after-tax proceeds of the upfront payment to accelerate share buybacks. The company now expects to return approximately $20 billion in cash to shareholders in the form of share buybacks and dividends through fiscal year 2020. In addition, the transaction is expected to increase Starbucks' earnings per share by the end of fiscal 2021.

This is two companies leveraging each other's strengths. That should bring value to shareholders in both, while also increasing market share and awareness for Starbucks in markets where it's not yet mature.

Daniel B. Kline has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Starbucks. The Motley Fool recommends Nestle. The Motley Fool has a disclosure policy.