The empty grocery shelves many of us encountered during the coronavirus pandemic opened our eyes to just how vital the food supply chain is. Many people even began their very own backyard "victory gardens" for the first time. But most of us are not going to become self-sufficient anytime soon, and we will continue relying upon grocery stores and restaurants for the vast majority of our food needs.

That's why investors should consider buying food stocks: People are always going to need to eat. Below are three food stocks you should watch in June.

Family shopping for produce

Image source: Getty Images.

B&G Foods

Packaged foods specialist B&G Foods (BGS -0.18%) has been a COVID-19 pandemic all-star, notching sales gains of nearly 58% over the first two months of its second quarter, which encompasses the two full months when people were subject to stay-at-home orders.

As much as consumers were experimenting with their green thumbs during the crisis, new gardeners and longtime preppers alike were stocking up on canned basics. B&G, which owns top brands such as B&M, Green Giant, and Polaner, was a big beneficiary of the shelf-emptying that occurred in supermarkets across the country.

Even though B&G Foods' stock is up 118% from its recent lows as of Wednesday morning, it's still cheap, with lots of room to grow. Shares trade at less than 13 times estimated forward earnings and go for less than the last 12 months' sales. The company has been a serial acquirer of top brands, which could become a problem if a purchase goes awry. However, B&G Foods has also proved adept at organic growth, so this is a stock investors may want to keep an eye on.

Scotts Miracle-Gro

Not a food company in the traditional sense, Scotts Miracle-Gro (SMG -0.09%) is a close cousin to the industry through its selection of fertilizers and other products to boost the productivity of all those kitchen gardens.

Scotts is probably best known for its branded lawn care products, as well as the Roundup weed killer it licenses from Monsanto. More recently, its Hawthorne Gardening division, which focuses on the marijuana-growing industry, has made Scotts an especially popular stock; the unit's second-quarter sales soared 60% to $230 million, representing 17% of total revenue, up from 12% a year ago. Even the company's consumer-oriented lawn and garden care segment saw an 11% increase in sales over the last three months as more people puttered around their plots.

Scotts Miracle-Gro trades at a reasonable valuation considering its industry-leading position -- 25 times trailing earnings as of Wednesday morning -- and the behind-the-scenes food stock even pays a dividend of $2.32 per share annually that yields a modest 1.6%.

Walmart

During the pandemic, shoppers flocked to Walmart (WMT 1.32%). Comparable-store sales surged 10% in the first quarter while e-commerce sales rocketed 74% higher, helping it generate nearly $135 billion in revenue.

The retail giant benefited from being declared an essential business that was allowed to stay open during the pandemic, which gave it and other similarly designated corporate giants a competitive advantage.

Even with social distancing protocols enforced, store entrances restricted, and hours limited, so many consumers flooded its stores it was still able to record massive gains. That's not likely to change going forward, even with the economy reopening.

A number of retail rivals have declared bankruptcy and are committing to either reducing their physical footprints or liquidating their stores. And as the first-quarter results show, Walmart has excelled in the online marketplace, becoming an even larger, more efficient competitor to Amazon.com.

Yet Walmart's stock is only 17% above its recent lows, meaning new investors haven't missed out on much. The retailer has also paid a dividend every year since 1974, increasing the payout each year thereafter, making it a Dividend Aristocrat, and the dividend currently yields 1.8% annually.