The M&Ms maker said the investment, the largest made by the company in a single year, will help grow its snacking portfolio following its $36 billion acquisition of Kellanova.