In a crowded fast-food industry, brand loyalty is the secret sauce that separates the winners from the losers. Restaurant owners know that customers can become valuable repeat visitors -- but only if you consistently deliver an awesome guest experience.

Continue down that happy path and eventually your diners begin singing your praises to friends. And by personally vouching for you, they make it easier to grow your business without requiring a huge marketing budget. That process describes how a company like Starbucks (SBUX 0.53%) could soar to over 22,000 locations today from less than 6,000 in 2002.

This virtuous cycle works even faster in reverse, though, where the loss of brand strength can stop growth momentum in its tracks. For a prime example of that unappetizing progression, consider the recent experience of Subway.

A Subway sandwich.

Image source: Subway.

Subway in the hot seat

According to this year's customer loyalty ranking by Brand Keys, the sandwich specialist finished dead last among national quick-service restaurants. Subway fell to 13th place in the brand engagement survey, two spots below struggling fast-food titan McDonald's (MCD 0.37%), and on the opposite side of this year's leader: Chic-Fil-A.

The sandwich chain has endured declining sales for several years. In 2014, a 3% revenue slump knocked Subway out of second place in the U.S. market as Starbucks took over that spot. The trend only worsened the following year: Subway posted a 3.4% sales drop in 2015 compared to a 13% spike for Starbucks and an 8% boost for Taco Bell, according to research firm Technomic.

Subway has seen more than its fair share of negative publicity lately. The company had to break with longtime spokesman Jared Fogle, who became the face of the brand after losing over 200 pounds on a Subway sandwich diet, after he was brought up on child pornography charges. More recently the company had to knock down reports that it cuts its chicken with a dramatic amount of fillers. "The allegation that our chicken is only 50% chicken is 100% wrong," CEO Suzanne Greco said in early March.

Subway has been facing more practical challenges, too, including trouble adjusting to consumers' shift away from bread-heavy meals and toward choices that are perceived as more nutritious.

A recipe for a rebound

The chain has a few powerful tools at its disposal as it works to engineer a rebound. Its best shot at reinvigorating customer traffic is in moving its menu closer to what customers are demanding today. McDonald's showed how this process can work wonders. The burger giant's all-day breakfast shift just returned it to sales growth after two straight years of declines. Subway isn't as popular a breakfast destination, but any menu tweaks that emphasize convenience, health, and food quality should help.

The company is also hoping that a new logo and advertising campaign will help repair its image. Last August it revamped its look in a move that executives said would "position the Subway brand as a delicious, nutritious and affordable choice for today's discerning consumers." Ultimately, Subway must back up those claims by delivering guest experiences that leave customers feeling extremely satisfied with all aspects of their visit.

The best chains know that success here involves providing great food at a solid value, while also winning high marks in areas like customer service and store cleanliness. Subway would be wise to try to mirror elements of Starbucks' strategy. "The Starbucks experience," its management team explains in the 10-K report, "is built upon superior customer service, as well as clean and well-maintained stores that reflect the personalities of the communities in which they operate, thereby building a high degree of customer loyalty."