When is competition good for your business? When your rival makes your common niche more profitable. That's what's happening these days to premium hamburger joints Five Guys and In-N-Out Burger -- and the same idea applies to plenty of other famous rivalries as well.

The twin premium burger chains are examples of the rising fast-casual market, which also includes Tex-Mex guru Chipotle Mexican Grill (NYSE: CMG) and Panera Bread (Nasdaq: PNRA). Raising consumer interest in high-quality quick-serve food tends to be good for the entire sector.

To wit, Five Guys founder Jerry Murrell tells TheStreet.com that he loves the competition: "In-N-Out Burger just opened up in Dallas and when they opened up our business almost doubled. We help them and they help us. [...] The more In-N-Out grows, the better it is for us. It creates a better image for the industry."

And what a booming market it is: Shares of mid-cap Chipotle have more than tripled over the last two years as it rapidly expands its store network, while mid-cap Panera more than doubled. Fellow quick-gourmet restaurateurs Red Robin Gourmet Burgers (Nasdaq: RRGB) and Buffalo Wild Wings (Nasdaq: BWLD) have also crushed the recovering S&P 500 baseline, and all of them did it by exploiting the same highly specialized market. Foolish analysts love all of these companies.

What a novel idea!
What's good for the goose is gold for the gander. If you love one premium foodie, chances are you'll check out some other ones -- and maybe become a regular there, too.

This is not the first time a pair or even a gaggle of competitors work side by side to create a new market with exponential growth. The most recent example is in smartphones, where Apple (Nasdaq: AAPL) kicked things off with the first iPhone, and the Android team jumped aboard with a slew of alternatives.

One platform would never have grown the smartphone market as quickly as the duopoly has done. Gift baskets should be shuttling between Mountain View and Cupertino on a regular basis, thanking each other for all the help. This is why all the talk about "iPhone killers" is so ridiculous: Nobody is trying to kill anybody else here, and it would be counterproductive to try.

This opera plays out on the turnpike leading into every new business model. Whether it's top-notch fast food, premium phones, or business intelligence software, the market grows faster amid heavy competition than with one behemoth doing it all.

Exploiting the idea
The real trick for us hungry investors is to pinpoint which stocks stand to benefit the most in a co-opetition situation like the "better burger" sector. That means separating the chaff from the wheat (or the gristle from the meat) and buying into the best of breed before every other investor figures it all out.

That's one reason why data mining specialist Teradata (NYSE: TDC) is poised for a major breakout right now. The modest mid cap has found a very profitable niche where nobody can quite match its expertise, but plenty of well-respected and much larger rivals are trying to steal its business. In doing so, Teradata gains exposure and free business leads with every marketing move those bigger brutes make.

To learn more about Teradata and its co-opetitive genius, you should click here to download a free report on that very topic. What you read there might even make you appreciate the genius of your favorite burger joint more. This report is 100% free -- what are you waiting for?

Fool contributor Anders Bylund holds no position in any company mentioned. Click here to see his holdings and a short bio. The Motley Fool owns shares of Red Robin, Apple, and Chipotle. Motley Fool newsletter services have recommended buying shares of Buffalo Wild Wings, Chipotle, Panera Bread, Teradata, and Apple. Motley Fool newsletter services have recommended creating a bull call spread position in Apple. Motley Fool newsletter services have recommended creating a write covered strangle position in Red Robin. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.