After its share price skyrocketed over 76% in 2013 and over 160% over the past five years, Jack in the Box (JACK -3.27%) has climbed nearly 20% year-to-date.

Jack in the Box, which owns both the Jack in the Box and Qdoba Mexican Grill concepts, has been able to flourish in a highly competitive US environment where McDonald's (MCD 1.70%) continues to underperform and the fast-casual concept of Chipotle (CMG -1.34%) keeps nibbling away at the overall market share of traditional fast-food companies.

Why has Jack in the Box been so successful over the past few years, and more importantly, why is its stock up nearly 20% this year?

Things have been bright for Jack in the Box so far in 2014.  Credit: Jack in the Box

The Jack in the Box and Qdoba concepts are holding their own on earnings
Jack in the Box saw its overall revenue slip 1.8% to $340.9 million for its second quarter of fiscal 2014. Despite the drop in revenue, net income surged 18.9% to $15.8 million due to improved margins, refranchising benefits, lower food and packaging costs, and less discounting -- particularly within the Qdoba restaurants.

The big positives came with same-store sales growth. While Jack in the Box improved on its 0.1% growth in the year-ago quarter with 0.7% growth, Qdoba saw same-store sales soar 7% for the quarter, a vast improvement over its negative 1.7% growth in last year's second quarter.

By comparison, McDonald's continues to scramble within the US market where it posted negative May same-store sales again with a drop of 1%, even with growth of 0.9% worldwide. During its most recent quarter , McDonald's saw its revenue increase 1% to $6.7 billion. However, its net income fell over 5% to $1.2 billion as rising commodity costs hurt its bottom line.

Chipotle's most recent quarter saw success on both the top and bottom lines with revenue up 24.4% to $904.2 million as net income climbed 8.5% to $83.1 million. Same-store sales were immune to severe weather and rose 13.4% for the quarter. Despite the news of increased traffic and average transaction size, management cited higher commodity costs as an ongoing issue on the conference call.

Year-to-date, Jack in the Box remains one of the stock market's favorites within the quick-serve restaurant segment. As shown below, the chain has outperformed both McDonald's and Chipotle, respectively.

JACK Chart

Data by YCharts

But why is Jack in the Box up nearly 20% this year?
We could say that Jack in the Box's 2014 success really started at the end of 2013.

Between September and October of 2013 , Jack in the Box revamped its late-night menu by changing the atmosphere at its restaurants after 9 p.m. Aside from flipping over the menu boards, employees now change their uniforms, change the restaurant music, and most recently have expanded the menu to include unique items not available at other times during the day.

The change in leadership also turned out to be a huge positive for the company. After Linda Lang retired at the beginning of 2014, Lenny Comma took the baton and continued the growth momentum. Because Lenny Comma has been with the company since 2001, there was little disruption of company culture and long-term goals.

While many peers have tried to expand their menus by including items for health-conscious individuals to compete with fast-casual threats by companies like Chipotle, Jack in the Box has stayed close to its core customer base.

The Bacon Insider Burger, launched in January , is a good example of the company meeting demand. US foodservice consumers ate some 1.1 billion servings of bacon in the year ending April 2014, a 6% increase in servings compared to a year ago, and this burger fits current trends.

Other product launches at Qdoba restaurants, which include the Queso Diablo and Queso Verde items, have been equally successful.

But we can also look at the competition and its own struggles as a reason for Jack in the Box's success.

McDonald's had a bad 2013 with its Mighty Wings failure and has been trying to find ways to improve on its core items in recent months, which include its french fries and breakfast menu.

On the other hand Chipotle, which competes directly with Qdoba, recently raised menu prices by as much as 9% for some items like its steak burrito bowls. This might be a big reason for Qdoba's recent pop in same-store sales and could be a good reason to be optimistic on Qdoba growing much more in the next several quarters.

Qdoba has seen same-store sales climb strongly in the past several quarters. Credit: Jack in the Box

Nevertheless, Qdoba has been holding its own against Chipotle for awhile now. In a recent 2014 Consumer Reports fast-food survey, Qdoba ranked closely behind first-place Chipotle within the Burritos category .

Last, but possibly most important, are two recent announcements by Jack in the Box's management.

First, on the last conference call, management stated that the chain has now bought back $202 million worth of shares in a buyback program that year-to-date has already exceeded the totals for the past four years.

Second, because Jack in the Box now has much more stable and predictable cash flows, it recently initiated a regular quarterly dividend of $0.20 per share.

Dollar amount in millions in terms of share repurchases year-to-date already by Jack in the Box.

Bottom line
Two straight quarters of solid earnings definitely played a big role in Jack in the Box's move upward in 2014 thus far. However, its overall business strategies for both the Jack in the Box and Qdoba restaurant concepts are now paying off in huge dividends.

Qdoba, especially, has become more of a contender than a pretender in challenging Chipotle for the top spot in consumers' tastes.

With just 2,250 Jack in the Box locations and just over 600 Qdoba locations nationwide, the company still has plenty of room to expand.