Walk into any Starbucks (SBUX -0.54%) and you may hear the person in front of you order a drink that does not appear on the menu.

In fact, in some of the chain's locations you may even see hand-designed signs promoting beverages not officially offered by the chain. It's called a "secret menu" and it's a phenomenon the coffee company has embraced if not officially endorsed.

Some Starbucks' secret menu frozen drinks were brought to the real menu in 2015. Image source: Starbucks.

What is the company's stand?

"Starbucks does not have an official 'secret menu,' however our customers are always trying out new ways to customize their favorite drinks according to their personal taste preferences," a company spokesperson told The Motley Fool via email.

That's technically true. The secret menu is not official, but much of it has become standardized after a fashion. There are certain drinks -- like Purple Drink or the Cotton Candy Frappuccino -- that have become well-known, albeit not-quite legitimate choices. In many cases, it's possible to order these concoctions in the same way you would a regular menu item. In others, where the barista is not clued in (since secret menu recipes are not part of the company's training) it's best to be able to tell the person making your drink how to make it.

That's where the company acknowledged in its email that baristas have the power to make lots of things not officially listed for sale.

"In addition to what's on our menu boards, there are actually 170,000+ ways baristas can customize beverages at Starbucks, including selecting from a variety of milks, syrups, coffee/espresso options, and topping," the spokesperson wrote. "If customers would like to order a beverage that is not listed on our menu boards, we recommend they know the recipe so that their barista can handcraft the beverage perfectly for them."

To further confuse matters, in addition to individual stores sometimes promoting secret menu drinks via handmade signs, the actual company has blurred the line by bringing some secret menu items to the actual menu. In 2015, in celebration of the 20th anniversary of Frappuccino, Starbucks offered six new flavors that were "made popular by Frappuccino fans," according to the company. A contest was conducted between Caramel Cocoa Cluster, Cinnamon Roll, Cotton Candy, Cupcake, Lemon Bar, and Red Velvet Cake with the winner, Caramel Cocoa Cluster, actually being brought back in summer 2016.

In addition, sometimes baristas get orders for discontinued menu item that stores still have the ingredients to make. That can lead to the company bringing back something it had previously taken off the menu.

"Currently, we're also featuring another off-menu drink that has returned to stores – the Doubleshot on Ice," the company wrote. "This beverage was first featured on Starbucks menu boards in 2008 and has made a return. It is an icy, frothy espresso with a hint of sweetness."

Why do secret menus work?

Generally only brands with impassioned fan bases have secret menus. In some cases -- like In-N-Out Burger -- the secret is fairly public. In other cases, like Starbucks, it's not hard to join the secret menu club, but it's still not so widespread that ordering from it won't result in other people in line asking questions or maybe even the barista not knowing how to make your drink.

Sarah Walker Caron, senior editor for The Bangor Daily News, explained in an interview with The Motley Fool that secret menus are not new but the general public knowing about and ordering off them is.

The Internet has turned secret menus into something that's easily searched, she said. "But really, for decades secret menus have been shared privately via word of mouth ... As a child in the 1980s, whenever I went to Burger King, I would order a grilled cheese from their secret menu -- a bun turned inside out with two slices of American cheese in the center toasted in the BK broiler."

Caron, who wrote the book Grains as Mains and authors the food blog sarahscucinabella.com, explained that secret menus can be a sales driver because people like the idea of ordering something forbidden.

"It has an inherent desirability with its clandestine nature," she said. "In the early 2000s, as Jamba Juice grew in popularity, I remember a friend excitedly telling me about all the secret menu items she'd learned about there with a reverence in her voice, like she'd stumbled on something that set her (and me) apart from others."

A secret menu can essentially give status to people who know about it without excluding people who do not because they don't know they are missing something.

"Ordering from a secret menu comes with a sense of exclusivity, like the customer is part of an underground club," Caron said. "It's the modern day speakeasy, minus the illegalities, and the item names are the secret handshakes and code words."

Is this good for Starbucks?

Because the coffee chain already has a long menu where people customize drinks to often absurd degrees, its baristas are used to dealing with special requests. This means that while other chains might struggle with anything more complicated than "hold the pickles," the coffee company handles people ordering secret menu items -- even if the barista needs to ask for the recipe -- better than most chains.

That has two impacts on the bottom line. The sort of "in the club" mentality that Caron mentioned and a second level of simply offering good customer service. Being willing to make pretty much anything its ingredients can be combined into lets Starbucks keep more customers happy. Even simple off-the-menu items like making most Frappuccinos in "creme" coffee-free versions opens up the chain's offerings to more people (some of those choices are shown on official menus).

Having a secret menu drives loyalty while being accommodating drives sales. That's a smart combination that  Starbucks has exploited well.