Vehicles drive through the parking lot outside a Whole Foods Market Inc. location in Willowbrook, Illinois. Daniel Acker | Bloomberg | Getty Images

2017 was the year challenges facing retailers began to bleed into the consumer goods and food industries. As shoppers continue their shift online, companies are trying to figure out not only what shoppers want, but how to get it to them. Stores can no longer rely on malls for foot traffic and food giants increasingly can't rely on supermarkets for aisle visits. Retailers, whose boldest efforts to grow through to scale over the past few years were blocked by regulators, looked for new kinds of deals. This time around, they sought capabilities (digital, services), not more unused store space. The value of worldwide retail deals was $132 billion in 2017, a roughly 90 percent jump from the year prior, according to Dealogic. When they weren't doing deals, they were finding a partner to dance. Walmart and Amazon actively courted partners (Lord and Taylor, Kohl's as examples) as part of their ongoing battle for retail domination. Food companies, meanwhile, continued their quest for growth as pressure on them intensified and attempts to grow or innovate on their own continued to largely stall. That pressure seemed to have risen to the top of the C-suite, as an inordinate number of food CEOs stepped down this year or announced plans to. They included Mondelez's Irene Rosenfeld, General Mills' Ken Powell and Kellogg's John Bryant. Here are five lessons we learned this year. (You already know which deal topped the list, so feel free to read through slowly and enjoy the ride.)

Integrating is the hard part

John Greim | LightRocket | Getty Images

Chewy, founded in 2011, was a quickly growing online seller of pet food. Its roughly $3 billion sale to PetSmart was one of the biggest ever e-commerce deals. It demonstrated how swiftly the retail landscape is changing and the big bets retailers are now willing to make. (Though admittedly easier to do when a company, like PetSmart, is private.) PetSmart was acquired by a BC Partners-led consortium in 2015 for roughly $8.7 billion, back when private equity investors touted the idea that "pet parents" would always and only go into stores to buy for their pets. Under BC Partners, it toyed with the idea of merging with rival Petco, an effort that stalled amid antitrust concerns. But the rise of e-commerce came at the industry fast. More stores are no longer the solution, and it turns out pet parents are more than happy to buy their food and products online. In buying Chewy, PetSmart sought to stamp out a competitor and build an internet presence and infrastructure faster than it could on its own. When the deal was announced, industry sources pointed to the surprising size of the deal, having found traditional retailers generally weary of making similar bets. They said to watch it as one of the first tests of large-scale unions of brick-and-mortar and e-commerce. The marriage has gotten off to a rocky start. Several independent food companies like Champion Petfoods and Fromm Family Foods announced they were pulling their products from Chewy, angered over its sale to a corporate owner. High-end dog food brand Blue Buffalo, a Chewy favorite, went mass, selling in retailers like Target. PetSmart CEO Michael Massey announced he was stepping down in August, four months after the deal was announced. It has also taken longer than expected to achieve its synergies and its bonds have taken a hit. Earlier this month ratings firm S&P Global Ratings downgraded its corporate credit rating based on weakening operating performance and finances. Some sources close to the situation say that PetSmart had little choice but to make a big e-commerce investment like Chewy. The sources also note it is still relatively early days, and the two may be able to find a balance.

Pay up for Big Food

Cooking spices manufactured by McCormick & Co. Jim Bourg | Reuters

The deal was not the sexiest of the year, but it was a sign of what to come. Reckitt Benckiser Group put its North American food business on the block to pay down debt following its $16.6 billion acquisition of U.S. baby formula maker Mead Johnson. It was one of several CPG carve-outs this year, as food companies seek to realign their business. The assets included Frank's Red Hot sauce business, French's mustard and Cattlemen business. At the onset, industry insiders expected a crowded sale process — it was one of the few food businesses of scale that was still growing, and companies have waited for years for it to be up for sale. No one, though, anticipated the price it would fetch. Spice-maker McCormick beat out a number of interested parties, including Conagra and Unilever, paying a whopping $4.2 billion — or 19.6 times earnings before interest, tax, depreciation and amortization. The long-term average of major deals in the sector meanwhile is 16.2 times, according to Bernstein analysts. McCormick's CEO took to CNBC to defend the deal price. Industry sources said the it may have set a new bar. Others later joined McCormick in doling out big prices grasping at growth. Kellogg is buying upstart protein-bar company RXBar for $600 million. Campbell Soup and Hershey both announced their largest ever deals earlier this month. Expect more big prices and food deals to come in 2018.

To take a retailer private, it's Sycamore or bust

Getty Images

Sycamore Partners' $6.9 billion acquisition of Staples was the not-so-little deal that could. Staples was yet another company that had previously weighed scale to cope with a changing shopping landscape. Its efforts to merge with rival retailer Office Depot though were thwarted by a U.S. federal judge on antitrust grounds. The company, which made its name selling papers and pens, has for years been hurt by the digitization of the workplace and increased competition from online retailers. Its stock was pounded as it got swept up in general investor aversion to any retailer in the stock market not named Amazon or Walmart. It was one of several publicly traded retailers that sought escape in the private market (others included Party City and Nordstrom) but, with financing markets spooked, it was one of the few to find refuge. Its saving grace was its growing business-to-business platform, which some buyers thought to be a diamond in the rough. The question was how to disentangle it from its struggling retail business. That challenge scared off a number of financial buyers, including Cerberus Capital Management. Sycamore's aggressively creative co-founder forged a way. The private equity firm split the retailer into three parts. This allowed banks to finance the strongest parts of the business separately and give Sycamore the option to wind down its weakest unit — the retail business — at a later date. The move followed a playbook the private equity firm used in its purchase of The Jones Group. Other retailers looking for a similar escape valve may next year be able to find one: Sycamore is looking to raise largest ever fund, which will continue to focus on retail investments. It's still too early to asses what Sycamore is able to do with the business, but Amazon has already made clear it plans to be a competitor. In October, it announced the launch of Business Prime Shipping, a membership program for multi-user businesses.

Everything is always about Amazon

Getty Images

CVS Health's landmark roughly $69 billion acquisition will create the first health-care triple threat, combining CVS's pharmacy and pharmacy benefit manager (PBM) platform with Aetna's insurance business. Some sources close to the deal adamantly say that Amazon was not behind the transaction, but in today's world, everything is a reaction to Amazon, directly or indirectly. Over the past year, Amazon had made its presence known in the drug retail space, more recently having held preliminary talks with makers of generic drugs about its potential entry into the space, according to people familiar with the discussions. Drug stores were already under pressure, as shoppers can now find cosmetic and household staples at other retailers and online, sometimes for a lower price. Continuing a theme on this list, efforts to scale horizontally haven't gone through, and may now no longer make sense. Walgreen's attempt to buy Rite Aid in a $17.5 billion deal was whittled by regulators down to a purchase of 1,932 stores for $4.37 billion. Now that CVS/Aetna is announced, industry sources anticipate further deals. On the retail front, sources have said that, in order of likelihood, Walgreens, Walmart and Kroger may make similar health-care plays. Rite Aid has been identified by sources as a private equity target.

For retailers, it's Bezos beware

CNBC Make It