By 2040, 33 million of the vehicles sold annually will be fully autonomous, according to the predictions of analysts at IHS Markit.  Nearly every automaker is working on self-driving systems right now, and semi-autonomous features -- automatic braking, lane-keep assist, adaptive cruise control, etc. -- are already commonplace in new vehicles.

So, while the rollout of fully autonomous vehicles will likely be slow, it's undeniable that the transportation industry is moving quickly in that direction. And when the self-driving era finally arrives, it is expected to rapidly grow into a $7 trillion passenger economy.

That's why investors should pay close attention to what three companies in particular are doing in the driverless car space right now: Uber (UBER -2.04%), Lyft (LYFT -1.67%), and General Motors (GM 0.24%).

Uber's autonomous vehicles in a warehouse.

Image source: Uber.

Uber's AV pursuits have slowed

Uber is currently testing a small group of AVs on a one-mile stretch in Pittsburgh. The cars only drive about 25 miles per hour, and during their operations, there are employees in the driver's seats just in case something goes wrong.

In addition, the company also has employees driving vehicles equipped with autonomous systems in Toronto and San Francisco, but only so they can collect data that can be used to improve the software. In total, Uber has about 250 autonomous vehicles, and a workforce of 1,000 developing its driverless vehicle tech.

Uber's long-term goal is to be able deploy a fleet of AVs to supplement its human drivers. The theory is that self-driving cars could eventually help reduce transport costs. But while Uber could stand to benefit from that, it likely won't be developing its technology entirely on its own. After a series of setbacks that included crashes and an intellectual property lawsuit, the company has scaled back its in-house AV plans.

Instead, it has shifted toward forming partnerships. Uber has already received investment from Toyota to develop self-driving car technology.

Lyft depends on the AV tech of others

Lyft also has its own AV program with about 300 engineers right now. The division is lead by Luc Vincent, who previously worked at Google and is credited as a creator of Google Street View.

Even though Lyft has a self-driving team, it has focused far more on developing autonomous vehicle partnerships. One of its most important has been with self-driving tech company Aptiv. The two have been testing autonomous vehicles in Las Vegas for several years. So far, they've provided self-driving rides to 30,000 passengers.

Most recently, Lyft partnered with Alphabet's Waymo to bring 10 autonomous vehicles to Lyft's ridesharing platform in Phoenix, Arizona. It's an important partnership for both companies because Waymo is one of the indisputable leaders in the autonomous vehicle tech space. The company's autonomous vehicles have driven more than 10 million real world miles -- and 7 billion virtual miles -- and it launched its own commercial self-driving rideshare service in Phoenix at the end of last year.

Lyft could ultimately benefit from the partnership by expanding its test fleet of Waymo vehicles and bringing more trials to other cities. What's clear, though, is that Lyft now sees collaboration rather than pure competition as its best route to being able to serve customers with self-driving vehicles.

Cruise Automation car sitting by itself.

Image source: GM.

General Motors' self-driving future

GM has made several significant moves on the autonomous vehicles over the past few years, including restructuring the company to focus more of its energy on both self-driving and electric vehicles. But one of its most direct bets was the 2016 acquisition of Cruise Automation.

Cruise has developed fully autonomous driving technology and plans to launch its own rideshare service this year with 2,600 vehicles that not only can drive themselves, but must drive themselves: they have neither steering wheels nor gas and brake pedals. Cruise's plan is to start small, debuting the service in one city, then expand across the U.S.

The company has already received substantial investments from Softbank's Vision Fund, Honda, GM, T. Rowe Price Associates, and others. Over the past year, Cruise has raised $7.25 billion, and was most recently valued at $19 billion. 

Cruise also plans to double its staff of 1,000 by the end of the year and is spending loads of cash to stay ahead of the competition -- about $728 million in 2018. That figure is expected to jump to $1 billion this year.

And the better self-driving car play is... GM

While Uber and Lyft are forging important partnerships in the self-driving vehicle space, and Uber is developing some of its own autonomous vehicle tech, neither one comes close to what Cruise is doing. It's developing its own AV technology, and is testing it on public roads at a much grander scale than either Uber or Lyft. When Cruise's self-driving commercial ride-hailing service launches, it'll essentially be one of only two of its kind, the other being run by Waymo.

Additionally, GM's long history as an automaker gives it the know-how to not just develop the necessary AV tech, but to build high-quality AV cars from the ground up.

For those reasons, it's more likely that both Lyft and Uber will one day be using cars and technology developed by GM and Cruise, rather than their own proprietary systems. Finally, the carmaker owns about 18.6 million shares of Lyft. Add it all up, and it's clear that among these three aspiring AV companies, GM has the upper hand.

Editor's note: This article has been corrected. Uber has not tested autonomous vehicles from GM or Waymo on its platform.