"We expect the full Pirate Brands portfolio to be a great fit for Hershey's growing Amplify business which is targeted toward consumers who are looking for great-tasting snacks without compromise," said Mary Beth West, Hershey's chief growth officer, in a statement.

Amplify also manages BarkTHINS, the chocolate snacking company Hershey's snatched up in 2016.

A number of other companies have made hefty investments in the health food trend in an attempt to lure customers with alternatives to sweet or fatty snacks.

In June, Conagra(CAG) agreed to shell out $10.9 billion for Pinnacle Foods, which makes Smart Balance and Udi's Gluten Free Foods, among others. PepsiCo(PEP) announced last month that it is buying DIY seltzer maker SodaStream for $3.2 billion. Earlier this year, PepsiCo said it is acquiring Bare Snacks, which makes baked fruit and vegetable snacks.

Hershey's said the Pirates snacks will help it break into the more than $2.5 billion cheese puffs category. The company noted that Pirate's Booty is the fastest-growing brand in the category, with 8% growth year over year.

For B&G(BGS), capitalizing on the health food trend has already paid off.

"We acquired Pirate Brands in 2013 for approximately $195 million," B&G CEO Robert C. Cantwell said, and "have more than doubled the value of the business in five short years, creating tremendous value for our shareholders."