Uber Technologies (UBER -2.48%) is one stock I have long urged investors to avoid. While the ridesharing industry is likely here to stay, high costs made the company a consistent money loser. Consequently, its stock has only experienced modest growth since its initial public offering (IPO) more than four years ago.

However, conditions changed in the second quarter of 2023 when the company reported a profit. With that change, Uber may finally have the fundamentals to take the stock higher.

The state of Uber

Uber stock initially surged in May 2019 following its IPO. But as investors took a closer look at the financials, they saw no obvious path to profitability. The stock consistently fell until a pandemic-induced revival took it higher, but it could not sustain those gains in the 2022 bear market.

Nonetheless, in 2023, Uber appears to have turned a corner. Year to date, the stock is up around 85%. The difference now is this is the first Uber rally where investors can point to sustainable profits.

Second-quarter revenue of $9.2 billion rose 14% year over year. A 25% increase in revenue from mobility and a 12% rise in delivery offset the 30% decline in freight.

Moreover, a lid on expenses helped Uber report operating income of $326 million during the quarter, a record high for the company. Free cash flow of $1.1 billion also set a new record, further reinforcing Uber's financial strength.

And despite the year-to-date rally, Uber may have just started its long-term ascent. The price-to-sales (P/S) ratio now stands at 2.6. That is well below its peak of 10 from early 2021. And while that valuation is higher than the the 1.0 times sales of archrival Lyft, Uber is larger and profitable, which arguably justifies the premium.

How Uber turned profitable

Indeed, one factor in that recovery was probably its size. It operates in more than 10,000 cities in over 70 countries, while Lyft operates only in the U.S. Assuming the recent revenue growth is sustainable, profits should maintain an upward trajectory.

Furthermore, Uber benefits from a network effect. Since it has attained industry-leading brand awareness, prospective riders can use its app worldwide. This fosters a virtuous cycle that helps it attract more riders and drivers.

Additionally, Uber offers food delivery and freight services, two business lines that can further attract drivers and customers. It also bolsters these businesses through Uber One, a subscription service that includes discounted rides and free food delivery. This provides a considerable disincentive to turn to competitors.

Uber has followed the lead of Meta Platforms and Amazon by selling ads too. With more than 400,000 active ad merchants, this segment reached a $650 million revenue run rate as of the second quarter.

Finally, long-term investors should not ignore the potential of autonomous driving. Self-driving cars will reduce the need for drivers, a cost that made profitability difficult before Uber built out its broader ecosystem. If the company can significantly reduce what it pays to drivers, the profit potential should rise much higher from current levels.

Consider Uber stock

Uber stock can succeed because it has evolved from a rideshare platform to a full-fledged ecosystem. That ecosystem draws in more riders and drivers, and such brand awareness can make it a natural choice for food or freight delivery.

Consequently, the company can build on top of a now profitable base. And if it can successfully venture into autonomous vehicles, Uber may be just scratching the surface of its growth and earnings potential.