Uber (UBER -0.38%) eked out a $326 million profit in the second quarter, but that could just be the start. The driving factor behind Uber's Q2 profit was operating leverage. Gross bookings increased by $4.5 billion while management reduced expenses by $200 million. 

Big cost savings came from general and administrative costs as well as from marketing. The latter speaks to a strong competitive advantage that should support long-term profitability. Let's dive into the details.

The network effect in full effect

Despite reducing marketing expenses, Uber saw active users and total trips increase substantially in the second quarter. Users who completed a ride or delivery in Q2 reached 137 million, up 12% year over year. And total trips grew even faster at 22%. Put simply, Uber is seeing more people using its app more often.

Meanwhile, it kept its sales and marketing expenses flat for the quarter. Over the last 12 months, Uber's actually reduced how much it spends on marketing, yet it's attracting more customers. In fact, user growth accelerated in the second quarter.

The results are evidence of a strong network effect. Uber's network consists of three pillars: consumers, drivers, and restaurants (or stores). Each pillar of the network supports the others. For example, if Uber entices more consumers, more drivers and restaurants are attracted to the platform because they can more easily find customers. If Uber attracts more drivers, more consumers and restaurants come to the platform because they'll have an easier time connecting with a driver.

That's allowed Uber to sustain its growth amid pricing pressure from smaller rivel Lyft. As Lyft has cut prices, Uber's been able to maintain its market share of gross bookings, according to CEO Dara Khosrowshahi. And while Lyft's actions have shown up in its financial results, with lower revenue per rider, Uber hasn't seen much adverse impact in terms of pricing pressure or switching.

Building on the operating leverage

Uber has more levers it can pull on top of its customer acquisition capabilities. One particularly exciting area is its burgeoning advertising business. As more users come to Uber's platform, it creates more opportunities for Uber to advertise. Uber's advertising run rate reached $650 million last quarter. Management still expects to generate $1 billion in ad revenue by next year.

Another area of growth is Uber One, its subscription offering. Not only is Uber One a source of revenue, but it helps increase switching costs (the hurdles of switching to a competitor). That's one of its biggest vulnerabilities. Building out the Uber One offering remains a meaningful opportunity to grow revenue per user and improve operating leverage.

One last area for leverage is in the freight business, which has dragged down profits over the last three quarters. That said, EBITDA losses for the segment appear to have bottomed in Q1. Turning the freight segment around should be another source of profitable growth for Uber.

While Uber stock has performed well for investors thus far in 2023, there are good reasons the market has sent its share price higher. Even today, the stock sits well below its all-time high despite a much clearer outlook for future profits than just a couple of years ago. It might be worth adding a few shares of this gig economy stock to your portfolio.