I think that for outstanding performance in the long term, investors need to be buying slices of companies that have one or more strong competitive advantages in their favor. Whether it happens to be the company's size, brand loyalty, barriers of entry into industry, or others, buying into a competitive advantage rather than hype will help your results tremendously.

Two companies in the packaged food industry that I believe fit the bill are McCormick & Company (MKC 0.23%) and Flowers Foods (FLO -1.08%). Both of these companies provide what I would consider "recession-proof" products, which combined with their large distribution networks, should help these companies weather any storm the future may hold.

The spice rack

The biggest reason I view McCormick & Company as a recession-proof company is proudly displayed in huge text on the home page of their corporate webpage: "Saving Your World From Boring Food". If you read further they claim to be a "global leader in flavor" founded in 1889. Of course we love flavorful food, and McCormick & Company produces products that give us that kick.

McCormick & Company's brands include McCormick, Lawry's, Old Bay, Zatarain's, among plenty of other domestic and international brands. Along with their own brands they are also a producer of store brand products.

The bakery aisle

If you have ever eaten a sandwich, I can nearly guarantee you have bought a Flowers Foods product. They have a portfolio full of bread brands including Nature's Own, Wonder, Sunbeam, Merita, Cobblestone Mill, and others. It is almost easier to name the bread brands they do own rather than the ones they do not.

Flower Foods also sells snack cakes under the brand names Tastykake, Mrs. Freshley's, and Bluebird

Quantitative side of things

Having the best products in the world doesn't mean a thing if there are not efficient operations backing them up. Over the last ten years McCormick & Company has averaged profit margins over 9%, and return on equity over 24%. Flowers Foods, over the same time frame, has averaged smaller profit margins of 4.6%, but their margins have nearly doubled from just over 3% to just over 6% in the last ten years. They have sported a nice return on equity as well, though again lower than McCormick, averaging over 16%, but also growing steadily over the ten year time frame.

The strong performance of management in both profit margins and return on equity has also helped McCormick and Flowers Foods steadily increase their earnings per share from $1.52 to $2.91 and from $0.22 to $1.09, respectively. How has the market treated these companies? Let's take a look:

^SPX Chart

^SPX data by YCharts

Wait, companies making spices and bread can beat a market full of interesting companies??? You've got it. 

Staying power

The day that we as people prefer bland food over tasteful food and stop eating sandwiches is the day McCormick & Company and Flowers Foods will become irrelevant, and I don't see that day anywhere in the near future. McCormick & Company has been selling spices since 1889 and Flower Foods has been around since 1919, and it appears their foothold in their markets will keep them around for at least another 100 years.

Looking forward

Past results do not guarantee future returns whatsoever. But one should take note and like the fact that as of the end of 2013 McCormick & Company's board members and executives held 12.9% of the voting stock. Also, as of the end of 2012, when it was last reported, Flowers Foods' board members and executives owned 17.3% of the voting stock. Nothing should make you more confident of management interests' than managers having their own skin in the game.

McCormick & Company is trading at 24.2 times earnings, ahead of their industry average of 20.5 times, above their 5 year average of 20.4, and above the market average of 17.9.

However, Flowers Foods is trading at 19 times earnings, below the industry average of 20.5 times, below their 5 year average of 19.9 times, and ahead of the market average, 17.9 times earnings.

Both of these companies are competing in an industry that is very resistant to cycles in the economy, which makes evaluating the future much easier. At current prices, McCormick & Company looks to be the more expensive of the two, but you could buy a piece of Flowers Foods now at an attractive price. A purchase of McCormick & Company might not be a bad idea either, as you could always add to your position on stock price dips, and collect a nice dividend in the meantime.