ConAgra Foods, via Reuters

For ConAgra Foods, buying Ralcorp Holdings may have taken more than a year, but it was worth the wait.

By buying Ralcorp for about $5 billion in cash, ConAgra will become the largest producer of private-label packaged food in North America.

ConAgra has established itself with consumer foods populating many household pantries like Orville Redenbacher’s and Chef Boyardee. Now, it is betting that private-label goods — made for bakeries, grocery chains and other customers — will be a higher source of growth worldwide.

Related Links Documents: The news release

Together, the two companies would have combined private-label sales of $4.5 billion.

Once regarded as the stepchildren of the food aisles, private-label products have become brands in their own right as grocery store retailers have used them to set themselves apart from competitors. Such lines include Artisan Fresh at Sam’s Club, Simple Truth at Kroger and Culinary Circle in SuperValu’s chains, which features such items as broccoli and yellow Cheddar soup and raspberry chipotle meatballs.

Over the years, retailers invested heavily in improving the quality of their food products as well as the packaging and merchandising. Now, they have become ubiquitous among convenience stores, club stores, big-box retailers and specialty grocers like Whole Foods.

That is one reason ConAgra was willing to make another effort to buy Ralcorp even after it was rejected last year in its $5.2 billion takeover bid. Ralcorp was then focused on a plan to spin off its Post cereals division, which markets brands like Honey Bunches of Oats, Post Raisin Bran and Grape-Nuts.

That divestiture was completed in February. Shares in the new company, Post Holdings, have risen 28 percent since they began trading.

This year, Ralcorp had also given a board seat to Keith Meister, a longtime lieutenant to the activist investor Carl C. Icahn who had called upon the company to consider selling itself.

Several weeks ago, ConAgra approached Ralcorp about another deal, and effectively raised its offer for the business that remained.

“This is something that makes so much sense,” Gary Rodkin, ConAgra’s chief executive, said by telephone on Tuesday. “Within our own management team and our own board, it just seemed so compelling, from both a strategic and financial perspective.”

Investors in his company appear to agree. Shares in ConAgra jumped 4.7 percent on Tuesday, to $29.63, while those in Ralcorp surged 26.4 percent, to $88.80.

When the economy was weaker, consumers snapped up private-label brands, although a new report out on Tuesday from the SymphonyIRI Group, a market research firm, suggests that the growth of private labels might be slowing.

The study found that the private-label unit share of the total consumer packaged goods market fell to 17.1 percent in the 52 weeks ended Sept. 9 from 17.3 percent in the period a year earlier, although the dollar value of those products continued to inch ahead.

“Over the past two years, the trend of buying more private-label brands has been flattening out, with dollar sales ticking up more slowly and unit sales declining slightly,” said Susan H. Viamari, editor of SymphonyIRI’s Times and Trends reports. “Consumers are still frugal, but because national brands have stepped up their game, they’re gaining back some share they lost to private label.”

Still, retailers are continuing to make investments in developing private labels.

“Private-label brands really have become true brands,” Ms. Viamari said. “There was a time when they were knockoffs you would bury in the bottom of your cart, but now in many cases they are just as good or even better than national brands and represent a smart purchase.”

There is an argument, however, that companies that offer both branded and private-label products risk cannibalizing their brands or muddying their relationships with their customers. That may not be a danger for ConAgra because its brands do not emphasize its corporate parent, thus giving them sufficient distance to stand on their own.

“It’s a challenge to manage a product portfolio that is broader but more complex, but there are also opportunities because you can forge more and different relationships with retailers,” said David Garfield, who leads the consumer products practice at AlixPartners, a consulting firm.

ConAgra’s own private-label business has about $950 million in annual sales. But combined with Ralcorp, the unit could amount to about a quarter of the company’s sales, said Jack Russo, a stock analyst with Edward Jones.

“Since retailers are interested in dealing with top brands, not second- and third-rate brands, this is a move that should jump-start their growth rate because they now will have something else to sell that retailers want,” he said.

The deal is by far the largest the acquisitive ConAgra has struck in its history, according to Standard & Poor’s Capital IQ. It is more than triple the size of the company’s $1.6 billion takeover of International Home Foods, made in 2000.

Mr. Rodkin said that the benefits far outweighed the costs. He estimates that the combined company will have about $225 million in cost savings, and that the deal will begin adding to its earnings per share in its 2013 fiscal year.

ConAgra expects to pay for the deal with existing cash, bank facilities and new debt. It plans to issue up to $350 million in new shares to help maintain its existing investment-grade credit rating.

ConAgra was advised by Centerview Partners, Bank of America Merrill Lynch and the law firm Davis Polk & Wardwell. Ralcorp was advised by Barclays, Goldman Sachs and the law firm Wachtell, Lipton, Rosen & Katz.