2023 has had plenty of surprises, but one of the biggest has been the Uber Technologies (UBER -0.38%) comeback story.

For years, Uber stock was trading below its $45 initial public offering (IPO) price, initially slammed by wide losses and later by the pandemic. However, thanks to efforts to cut costs by jettisoning underperforming businesses, focusing on its most profitable markets, and the emergence of Uber Eats during the pandemic, Uber is now profitable and delivering excellent returns for investors.

It was also recently added to the S&P 500, a reflection of its achievement of generally accepted accounting principles (GAAP) profitability over the last four quarters.

Uber stock is now up 141% year to date, surging since its earnings report in early November and as investors have begun to bet that interest rates will come down soon.

While Uber has left rival Lyft (LYFT 1.87%) in the dust this year, even the No. 2 U.S. ride-hailing company has gotten a boost lately as Lyft stock is up 19% since Nov. 27.

Could Lyft follow in Uber's footsteps? Let's take a closer look at what would need to happen.

Can Lyft get a lift?

Lyft's recent spike hasn't come on any company-specific news. Instead, the stock seems to have benefited from the improving macro outlook as investors increasingly believe the Federal Reserve has finished hiking rates, and the economy can achieve a soft landing, meaning the Fed can bring down inflation without provoking a recession.

That sentiment benefits Lyft in a number of ways. First, ride-hailing is a cyclical business correlated with travel, work, and nightlife. If people aren't spending as much on those activities, as would be the case in a recession, then Lyft's business will be negatively impacted. Additionally, Lyft is still unprofitable on a GAAP basis and has nearly $1 billion in debt so falling interest rates would make it easier to borrow money and refinance its debt at a lower cost.

Lyft is making strides to narrow its losses. In the third quarter, the seasonally strongest period in the year, the company narrowed its net loss from $114.3 million in the year-ago quarter to just $12.1 million. Gross bookings in the quarter were up 15% year over year to $3.55 billion, and revenue grew 10% to $1.16 billion. The business is growing but not fast enough to impress investors. Lyft has also been profitable on an adjusted basis for the last three quarters, a key milestone for the ride-sharing operator.

The company is launching new initiatives like a program that allows women and nonbinary drivers to match with women and nonbinary passengers, and it also introduced in-app advertising in the third quarter, taking advantage of its valuable digital real estate as Uber has.

A person on the street hails a cab.

Image source: Getty Images.

Can Lyft follow in Uber's footsteps?

Lyft has long played second fiddle to Uber, and the recent numbers help illustrate why.

Uber's gross bookings grew 21% in its third quarter to $35.3 billion with revenue up 11% to $9.3 billion. The company is also seeing profit margins ramp up as it reported GAAP operating income of $394 million in the quarter, up from a loss of $495 million in the quarter a year ago.

In other words, Uber is multiple times larger than Lyft, growing faster, and now generating significant profits.

Though Uber and Lyft are competitors in the U.S., there are more differences than similarities between the companies overall. About half of Uber's gross bookings come from its delivery business, and Uber is a global company with a majority of its revenue coming from outside the U.S.

Lyft, on the other hand, only provides ride-sharing services, and only in the U.S. and Canada. In its quest to be GAAP profitable, Lyft doesn't have the same luxury as Uber did of cutting unprofitable segments as the company only has one business.

However, Lyft looks like a good value trading at a forward price-to-earnings ratio of 24, making the stock significantly cheaper than Uber, which trades at a P/E over 31.

If Lyft can continue delivering double-digit growth and improving profitability, the stock should continue to gain. It might not match Uber's performance this year, but there's a lot of room for Lyft to move higher at its current valuation and with a market cap of less than $5 billion.