While other food and beverage companies like Coca-Cola (KO 0.15%)Kellogg, and Campbell Soup have struggled recently, PepsiCo (PEP -2.97%) stock has bucked the trend and continued to grow.

Shares hit an all-time high earlier this year and have gained 12% over the last year, keeping pace with the S&P 500 while the company's peers have either held flat or fallen over that time frame. 

Though domestic soda consumption has steadily fallen, the company has found other ways to grow. In 2014, PepsiCo, with its popular snack foods in addition to its well-known beverages, was the leading contributor to retail growth in the food and beverage industry, adding $1 billion in U.S. sales growth. Its stable of high-profile brands such as Pepsi, Gatorade, Doritos, and Quaker make up the majority of its revenue, but research and development leading to new products has been a surprising source of growth.

How Pepsi does R&D
Pepsi has increased spending on research and development by 25% since 2011, with $718 million going to product innovation last year. Recent initiatives that have helped drive sales growth include a partnership with Taco Bell that has produced products like the Doritos Loco Taco and Mountain Dew Baja Blast, and healthier products such as Trop 50 and Quaker Oatmeal Express Cups. 

In 2012, the company opened a research and development center in China, its biggest outside of North America, which has focused on developing niche products for the Asian market like cucumber- and lemon-tea-flavored potato chips.

Research and development also played a key role in the company's development of its deep-ridged potato chips, which it made with the help of 3-D printed prototypes, and last year's introduction of the Spire, its customizable soda fountain to counter Coca-Cola's Freestyle. 

According to Pepsi, innovative products accounted for 9% of revenue in 2014, up from 7% in 2012, and the company was responsible for introducing 20% of new food and beverage products in the industry last year.  

Pepsi's efforts to expand its product line and revamp its brands have attracted the attention of its retail partners. The company was named 2014 Supplier of the Year by Wal-Mart, an award based on several performance metrics including sales and margin growth, return on investment, and innovation as a percentage of revenue. PepsiCo's sales at Wal-Mart increased 5% last year. Meanwhile, it also received three supplier awards from 7-Eleven earlier this year, including Innovation Leader of the Year.  

The competition isn't standing still
Pepsi's closest rival, Coca-Cola, has been working on its own pipeline of innovative products, such as the Freestyle machine and a Stevia-based low-calorie product, something Pepsi is trying to create, too. Coke has also diversified its portfolio with investments in beverage companies like Monster BeverageKeurig Green Mountain and wearable tech, and contributing to R&D in those categories. Meanwhile, Campbell Soup plans to launch 200 new products in this fiscal year, including new organic soups, fruit tubes, and veggie snackers. 

Still, while headwinds from changing consumer tastes affect all legacy food and beverage companies, Pepsi seems to be doing the best at adapting to this shift. Not only have its R&D efforts helped, but its diversified brand portfolio, which includes snacks and beverages, has also proven an advantage as soda sales have slowed.  

Continued growth isn't guaranteed for Pepsi, but increased spending on research and development should help the company keep outperforming its peers as the market shifts.