The world's population was roughly 7.4 billion in 2015, and it's expected to hit more than 10 billion over the next 40 years. Feeding those extra 2.6 billion mouths will fall on the world's leading farming companies. Which is why the strongest and most innovative farm stocks are the ones you want to own. Deere & Company (DE 0.08%) and Agrium Inc. (NYSE: AGU) both fit the bill as top farm stocks to buy in 2017 and beyond.  

1. The all-important equipment maker

Farm tractors and harvesters aren't what they used to be, and Deere is helping to push the boundaries. Roughly 80% of the company's revenue comes from agriculture sales, with the rest from construction and forestry products. It sells its iconic green equipment around the world. That alone is a good reason to favor this highly respected company.  

A John Deere tractor in India.

Image source: Deere & Company.

However, what's truly exciting about Deere is the new technology it's working on. It's a fairly complex suite of products including such things as autonomous machinery, precision in equipment control with GPS integration, and remote monitoring on devices from cellphones to computers. And this is a real commitment: The equipment giant's spending on research and development went from a little under 3% of sales in 2002 to about 6% of sales last year. Farmers looking to do more with less have a one-stop shop for equipment at Deere. That is likely to be an increasingly important distinction in the years ahead.  

The company has recently been working through an industry soft patch, but all of its businesses remain profitable. An adept management team has responded to the downturn by reducing headcount and streamlining the business to cut costs, with the goal of $500 million in structural savings by 2018. And there's one notable fact to understand about Deere's financial position: Debt on the balance sheet is overstated by the company's financing arm. At first blush long-term debt makes up almost 80% of the capital structure, but it's a more reasonable 40% (or so) once you pull out the $18 billion of financing-related debt.  

A sampling of Deere & Company technology.

Deere is increasingly shifting toward high-tech gear. Image source: Deere & Company.

Deere is a little expensive today with a P/E around 26, but that's on depressed earnings. Once the farming sector starts to pick up again, the company's top- and bottom-line results should head higher. And when you put what financially resilient Deere offers customers in the context of the long-term population picture, now could be a good time to act.

2. The do-it-all

The next farm company you should look at is Agrium. The company merits attention because of its offers an interesting mix of fertilizer production and selling farming supplies through a global chain of retail stores. None of its key competitors is structured the same way, and this business diversification is actually an important point of differentiation. 

For example, it employs around 2,000 agronomists across its roughly 1,400 global locations to provide advice to customers. The stores provide an outlet for its fertilizer, but more important, they create an important relationship that helps to stabilize the business during industry downturns like the one that's hitting the fertilizer market today. To put some numbers on that, fertilizer competitor Potash's (POT) gross margin was nearly cut in half between 2015 and 2016, while Agrium's gross margin only fell around 6%.  

Agrium's business is a mix of wholesale fertilizer sales and retail store sales.

Agrium's business is much broader than just fertilizer sales. Image source: Agrium.

It's an innovative approach to an industry that's subject to often-volatile price swings. And the company's retail business can be grown over time via acquisitions, providing an additional lever for sales and earnings. For example, the retail arm's EBITDA (earnings before interest, taxes, depreciation, and amortization) almost doubled between 2010 and 2015 thanks to acquisitions. It really is a nice complement to the fertilizer business.  

The wrinkle here is that the fertilizer downturn has led Agrium, which is heavily weighted toward nitrogen, to a so-called merger of equals with Canada's Potash, one of the world's largest potash companies. The combined entity will be a giant in the fertilizer industry with competitive cost advantages. More important, it will still retain the benefits of the retail business. I see this as a case of good companies getting better together as they increase their scale, but it increases uncertainty over the short term.  

You could just buy Potash and get the same benefits, but I'd suggest going with Agrium -- just in case something goes wrong with the merger. This way you make sure that you own the company with the retail arm, which is a true point of differentiation in the fertilizer space. Now is a good time to jump aboard, as well, because the downturn that's pushed this pair to merge has pushed Agrium's stock price down over 10% so far this year.

It's about the future

Farm stocks are facing headwinds today, but a growing need for food underpins the long-term outlook for the industry, based on global demographic trends. Sticking with the largest and best-positioned names is an important step in the right direction investing-wise. But so is finding the companies that do things a little differently, like Deere's increasingly technology-driven equipment and Agrium's unique combination of fertilizer production and retail. In my opinion, those traits make this pair top picks in the farm space today.