Uber and Lyft are racing toward their IPOs, with Lyft likely going public in the coming weeks and Uber likely not too far behind. And as these companies get ready to sell their shares in the public market, it's worth taking a closer look at what they're doing with autonomous vehicles (AVs).

Why do AVs matter for these two companies? Because in the coming decades, self-driving cars are going to hit the roads in full force -- and Lyft and Uber are trying to prepare for the future now.

Consider that by 2040, more than 33 million AVs will be sold annually around the world. And one of the biggest use cases for self-driving technology will be ride-sharing services. Intel says AVs will create a $7 trillion passenger economy by 2050, and that the mobility-as-a-service market (which will include autonomous ride-sharing services) will account for $3.7 trillion of that sum. Intel said in a report that "the transportation environment will be increasingly dominated by Uber, Lyft, Zipcar and a host of other ride-hailing and car-sharing services that are already driving down owned-vehicle usage in some metropolitan areas."

Alphabet's (GOOG 0.56%) (GOOGL 0.69%) Waymo is already preparing for this future and launched one of the first commercial autonomous ride-sharing services in Arizona at the end of 2018 (with plans to roll out the service in more cities this year). Waymo's move puts even more pressure on Lyft and Uber to develop their own AV services. Here's what each company is doing in this space right now.

An autonomous SUV with Uber branding.

Image source: Uber.

What Lyft is doing with autonomous vehicles

Lyft is a much smaller company than Uber, but the ride-sharing company is pushing just as hard as its rival in AV development. Lyft's AV team is headed up by Luc Vincent, who worked at Google for more than a decade and is considered the creator of Google Street View. The company currently has about 300 engineers and says it will double its headcount by mid-2020.

Lyft's AV team is working to create its own fully self-driving vehicle, and at the end of last year, the company purchased 3D-mapping company Blue Vision to help take the ride-sharing company's self-driving cars one step closer to reality.

Blue Vision's technology uses smartphones and other dashboard-mounted cameras to crowdsource 3D maps that help AVs know exactly where they are. Lyft said it will combine this technology with its own lidar-based mapping tech. (With lidar, lasers bounce light off objects to create a digital map.)

Aside from developing its own tech, Lyft is also looking to use its ride-sharing network to allow other companies to bring their self-driving tech to its customers. For example, Lyft has partnered with the autonomous vehicle technology company Aptiv (NYSE: APTV) to bring self-driving rides (in a limited area, using 30 Lyft cars) to Las Vegas.

To date, the Aptiv vehicles on Lyft's ride-sharing network have provided rides to nearly 30,000 Lyft customers, and Lyft says the partnership between the two has created the "largest public commercial self-driving network" to date.

With Lyft both developing its self-driving vehicle technology and partnering with other AV companies, the company is wisely pursuing multiple paths toward a self-driving vehicle future. All of which means the company's business should be able to benefit as more AVs take to the roads in the coming years.

An white BMW driving in Las Vegas with Lyft and Aptiv branding.

Image source: Aptiv.

How Uber is pursuing self-driving

Uber restarted its AV tests back in December after taking an eight-month hiatus. The company stopped its testing following a fatal collision between one of its self-driving vehicles and a pedestrian. 

The company currently has a much more scaled-back AV program than in previous years, with just a handful of self-driving vehicles on the road in Pittsburgh. The vehicles drive only on a preset one-mile stretch and can't drive faster than 25 miles per hour. While these tests are very limited, the company is likely taking a very conservative approach as it rebuilds trust with the public and local governments following its crash last year.

While Uber's AVs will only be on the road in Pittsburgh, the company is manually driving other vehicles in San Francisco and Toronto to collect driving data to use in its autonomous driving software.

Uber isn't just building out its AV tech, though. It's also partnering with automakers. Last year Toyota and Uber teamed up to combine some of their self-driving technologies. Toyota made a $500 million investment in Uber Advanced Technologies Group -- which includes Uber's self-driving project -- and Uber says it will use the partnership to bring AVs into its ride-sharing services in some markets next year.

While the Toyota partnership is still in its early stages, the move is an indication of how Uber's vast ride-sharing market (it has about 60% market share in the U.S.) could be used for autonomous ride-sharing services without the company's having to use its own technology.

Check out the latest earnings call transcripts for the companies we cover.

A line of Uber SUVs.

Image source: Uber.

Which ride-sharing company is best prepared for autonomous driving?

Both companies are doing a great job of enhancing their own autonomous vehicle technology development through partnerships with other AV tech companies and automakers. Right now, Lyft may have the upper hand because of its strong partnership with Aptiv and the fact that it has already completed tens of thousands of self-driving rides with actual customers.

Meanwhile, Uber is slowly building back its AV pursuits, and its partnerships haven't yet yielded the same results. But investors should remember that we're still at the very early stages of AV technology and that any advantage one company has over another at the moment is minimal.

Ultimately, Uber's ride-sharing dominance in the U.S. makes it an obvious choice for many automakers and AV tech companies looking to introduce self-driving tech to the masses. While Lyft has likely completed more autonomous rides now, nothing is stopping Aptiv from partnering with Uber in the future. Additionally, Uber's size and strong consumer brand mean the company can likely attract more partnerships in the future and potentially make larger partnership deals.

All of which means that Uber has a greater potential to benefit from the autonomous ride-sharing market in the years to come, even though Lyft's progress may seem more impressive at the moment.