Jay LaPrete / Bloomberg / Getty Images Patrons enter a Wendy's Co. restaurant in Columbus, Ohio.

There’s a restaurant in Wichita, Kan., that now offers a Bacon Portabella Black Label Burger (with mushroom sauce and Muenster cheese), an Apple Pecan Chicken Salad, a Monterey Ranch Crispy Chicken Sandwich and an Asiago Ranch Chicken Club. Interested? No need for reservations. You can pick them all up at the Wendy’s drive-thru.

In fact, you can order most of these items at Wendy’s 6,000 restaurants worldwide.

Just a few years ago, when Americans hungered for exotic flavors or artisinal anything, they didn’t seek it at Wendy’s or any other fast-food establishment. But quick-service restaurants are redefining themselves, starting with changes to the sorts of menu items they offer. They’re placing a sharper focus on ingredients and transforming their dining rooms into Starbucks-style hangouts, largely so they can compete with the growing popularity of so-called fast-casual restaurants like Five Guys, Chipotle and Panera Bread, which don’t offer table service but do have higher-quality items than fast-food joints. (Think of them as the middle ground between McDonald’s and Applebee’s.)

“I promise you three, four, five years ago, we couldn’t pronounce ‘asiago,’” says Wendy’s Senior Vice President Denny Lynch. “We certainly wouldn’t have known it was a smoked cheese that tastes great with chicken. It’s one of our more popular chicken sandwiches now.”

(MORE: Food Fight! Stores, Producers, Consumers Battle Over High Food Prices)

Last week, food industry research firm Technomic announced that Wendy’s had edged out Burger King for the first time ever as the country’s No. 2 hamburger chain. That’s thanks in large part to Wendy’s recent moves — and a lack thereof by Burger King. BK is just now starting its own makeover, firing its bizarre King mascot last year while unveiling a new line of BK Chef’s Choice burgers.

The movement toward higher-end menu items and a more friendly physical space won’t stop with Wendy’s and Burger King. Taco Bell recently announced a new Cantina Bell menu that looks like Chipotle-lite while White Castle is testing three special menus within existing White Castles: one that offers Southern-style barbecue and beer, another Asian noodles, and one offering paninis.

But this trend didn’t start with these restaurants either, but rather with the one fast-food chain that’s still beating everybody else.

McDonald’s, Reinvented

For almost a half-century, McDonald’s only got bigger. Every single quarter from 1954 until the turn of the century was better than the last for the fast-food giant. But in 2002, McDonald’s suffered its first quarterly loss due to a combination of factors. For one, McDonald’s failed to respond to customer demands in its rush toward continual expansion. Not coincidentally, it was the same year that Eric Schlosser’s widely read book Fast Food Nation appeared, pinning much of the country’s obesity epidemic on the fast-food chain. The book not only changed minds about the industry, but also reflected changing attitudes about what we were putting in our bodies.

With consumers starting to demand more health-conscious choices while complaining about the chain’s customer service and overall cleanliness, McDonald’s decided it was time for a change. Beginning in 2003, McDonald’s began a radical transformation, slowing the number of new stores it opened so it could focus on revitalizing its menu while paying more attention to customer needs and attitudinal shifts toward premium, nutritional foods.

(MORE: Demand For Gas Has Fallen, Yet Prices Keep Rising)

That’s why today when you walk into a McDonald’s, you’ll see an Angus Mushroom & Swiss Burger, a Chipotle BBQ Snack Wrap, Fruit ‘N Yogurt Parfait, and a McCafe Iced Caramel Mocha — as well as the ever-popular Dollar Menu and Big Macs.

Since the shift, McDonald’s sales have only gone skyward. Total revenue increased from $50.8 billion in 2004 to $77.4 billion in 2010.

“To be able to sell Angus burgers at that price [about $4] and not lose anything in terms of speed and consistency is pretty shocking,” says Gloria Cox, a principal at The Cambridge Group, a growth strategy consulting firm. “McDonald’s has shown it can be done, and that may have caused others to say, ‘If they can do it, maybe we should give it a try, too.’”

The Fight Against Fast-Casual

Meanwhile, new restaurants were emerging that began chipping away at fast-food’s customer base. Places like Five Guys, Chipotle, Panera Bread and Smashburger all gave Americans another option: meals that were a bit more expensive but perceived as much better quality. Sales at Five Guys, which began with one location in 1986 and now has close to 1,000, grew by 38% from 2009 to 2010. Sales at Chipotle increased 20.7% in the same period. (McDonald’s bought a majority stake in the chain in 2001 but divested from it five years later.) Panera Bread boosted revenue 24% from 2007 to 2010, and that was at the height of the recession.

Fast-food restaurants took notice. Lynch says Wendy’s felt like it was getting squeezed between the Five Guys of the world and convenience stores like 7-11, which increasingly over a wide variety of hot food.

“What was happening was our top end was being peeled off, and our low, bottom end was being peeled off,” Lynch says. “And you don’t want to get stuck in the middle.”

So Wendy’s went to work. Around 2009, it started upgrading its menu: first salads, then French fries, then its chicken sandwiches and burgers. They visited New York City and to analyze what some successful salad-only restaurants were serving.

Now Wendy’s offers fresh strawberries and almonds on their salads. Their French fries have sea salt on them. Their patties are thicker. They use red onions instead of white. Instead of ordinary sliced dill pickles, they’re now crinkle-cut.

(MORE: McDonald’s Dollar Menu Shake-Up: No More Fries and Drinks for $1)

“We’re not doing this alone,” says Lynch. “McDonald’s has invested heavily into their menu. Burger King’s trying to elevate their product offerings. Taco Bell is trying to upgrade their offerings. The pizza chains are introducing gourmet pizzas. This isn’t just Wendy’s. I wish it was.”

Still, as Wendy’s focused largely on ingredients, Burger King focused its advertising on college-aged dudes, emphasizing its semi-creepy King mascot in its TV ads instead of focusing on refreshing its menu. So over the last five years as McDonald’s grew by 26% and Wendy’s by 9%, Burger King’s sales were flat. (The King was officially retired in August.)

“We want to be the biggest,” says Lynch. “But that’s probably never going to happen. But we can be viewed as the best, the best in quality. If you’re No. 1 in quality, your sales are going to be there.”

Fast-Food Chains as the New Hangout

It’s not just fast-food menus that are undergoing transformation. Burger and taco chains are taking cues from another unlikely competitor: Starbucks. Among restaurant chains, Starbucks is now No. 3 in sales in the U.S., and one of the biggest draws for loyal Starbucks customers is the physical space.

For years, restaurants have taken note of the Starbucks effect: People come for a cup of coffee, hang around for a few hours because they like the atmosphere, and end getting hungry and buying food. Why wouldn’t fast-food customers follow the same pattern?

While places like Five Guys and Panera Bread have much newer locations, some Wendy’s and McDonald’s restaurants are 30 to 40 years old, which is why Wendy’s is currently remodeling 50 of its stores and building 20 more using newer designs that look sleeker and less sterile, have a range of seating, and offer Wi-fi.

Similarly, White Castle is renovating 15% of its restaurants every year and redesigning them into spaces where customers feel free to hang out.

(MORE: Taco Bell, Transformed: Major Revamp of the Menu, Slogan, Restaurant Vibe)

“Fast-casual has raised the bar,” says Darren Tristano, executive vice president of the industry consulting firm Technomic. “When your competitors are doing this, you don’t want to lose relevance.”

So don’t be surprised if the Bacon Portabella Black Label Burger (with mushroom sauce and Muenster cheese) or a new dining room with Wi-fi and ample booths show up at your local Wendy’s soon.

“That’s where the tastes of the country are going,” says Lynch. “So that’s where we’ll go.”